in reply to Newbie question No.2
qw/STRING/
Evaluates to a list of the words extracted out of STRING,
using embedded whitespace as the word delimiters. It can be
understood as being roughly equivalent to:
split(' ', q/STRING/);
the difference being that it generates a real list at
compile time. So this expression:
qw(foo bar baz)
is semantically equivalent to the list:
'foo', 'bar', 'baz'
Sooo, since whitespace is the delimiter for qw, you get
'Thequickbrownfox' when you print out the array.
Try this:
foreach(@list){
print "$_ "
}
print "\n";
Note, that this actually prints:
'The quick brown fox ' (trailing space), but it illustrates
the idea. Best of luck!
-beernuts
|
|---|