We don't bite newbies here... much | |
PerlMonks |
Re: Re: playing with mapby mirod (Canon) |
on Mar 09, 2001 at 23:20 UTC ( [id://63317]=note: print w/replies, xml ) | Need Help?? |
Not exactly, more like: for (0..$#old) { push @new, act_on( $old[$_] ); }usually written as: foreach @old { push @new, act_on( $_); }If act_on returns a list then all members are pushed into @old. Update: darn! merlyn is right, you need to initialize @new to () to get the exact equivalent statement.
In Section
Seekers of Perl Wisdom
|
|