NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Re: (Score:1)
I thought it was common knowledge that there is no such thing as a list in scalar context. :-)
The context issues are particularly important when you
returnthings.my $foo = bar();will produce a different result with abarfunction that doesreturn @arr;vs one that doesreturn ( $baz1, $baz2, $baz3 ). This is even more insidious if you do something likereturn grep quux($_), @arr.Always mind your context.
Your particular example, btw, besides all the issues already pointed out by others, should at least be written without that anonymous array in there:
which then leads to the further simplifications ziggy [perl.org] pointed out.
Reply to This