perl function qw
https://www.theitroad.com
The qw
function in Perl is used to create a list of strings, with the strings being separated by whitespace. It is a shorthand way of creating a list of quoted strings, which can be useful when working with lists of words or short phrases.
Here is an example of using the qw
function to create a list of strings:
my @fruits = qw(apple banana orange); print join(", ", @fruits); # prints "apple, banana, orange"
In this example, we define an array @fruits
and assign it the list of strings "apple", "banana", and "orange". We then use the join
function to join the elements of the array with a comma and a space, and print the resulting string to the console. The output of this program will be "apple, banana, orange".