qw// is a construct which quotes words delimited by spaces. use it when you have a long list of wordes that are not quoted or you just don't want to type those quotes as you type out a list of space delimited words
gnana
Oct 31st, 2006
the quoting opeator for lists is qw.advantage of qw is you need not quote the strings in additional way as qw already does quoting.
qw stands for 'Quote word'. It usually used to create array. Ex. @arr = qw/one two three/; This will create an array with elements one, two and three.
Instead of '/' symbol, any other symbol can be used. Ex. @arr = qw #one two three#; @arr = qw %one two three%;
If using brackets as symbol, we have the option to use open and closing braces on either end. Ex. @arr = qw [one two three]; or, @arr = qw{one two three}; or, @arr = qw (one two three);
Note: Each space considered as seperator for new element.
What does 'qw(..)' mean? What's the use of it?when do we use it?