Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Avoiding vivification with array sliceby ikegami (Patriarch) |
on Sep 09, 2008 at 19:45 UTC ( [id://710184]=note: print w/replies, xml ) | Need Help?? |
The point of the defined wasn't to prevent autovivification, but to implement the grep you had in your original code. The following two snippets are equivalent.
What you suggested (@b = map { $a[$_] } 0..5;) is *not* equivalent.
In Section
Seekers of Perl Wisdom
|
|