in reply to Re: Avoiding vivification with array slice
in thread Avoiding vivification with array slice
Cool. Accessing $a[$i] isn't enough to vivify (otherwise your defined test would do it).
So we don't actually need the defined test in your map and can get away with:
# This *doesn't* vivify $a[3,4,5] @b = map { $a[$_] } (0..5);
Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Avoiding vivification with array slice
by ikegami (Patriarch) on Sep 09, 2008 at 19:45 UTC |
In Section
Seekers of Perl Wisdom