good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
None is better, because they do different things! qw// is basically a compile-time construct that (as Deparse shows) returns a LIST. \ LIST is a special form of reference-list constrctor and returns a LIST where each element is a reference to the element of the original list:
[] creates an anonymous ARRAY-ref, which turns out to be a scalar value in the end:
So when you evaluate \LIST in scalar context, you get what you alway get when forcing a list to scalar context: the last element:
HTH --http://fruiture.de In reply to Re: qw with anonomous list ref
by fruiture
|
|