|
|
| We don't bite newbies here... much | |
| PerlMonks |
Re: qw with anonomous list refby fruiture (Curate) |
| on Oct 28, 2002 at 22:56 UTC ( #208632=note: 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 Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||