in reply to Re^3: Can this script be Optimized?
in thread Can this script be Optimized?
No, just pointing out that map (and grep) are basically equivalent to for. But like many other features of Perl, they can make some things easier to code and easier to read.
Your point is correct. One additional detail is that a new array (actually list) is always created.
So, it would really be more like:
{ my $newarray; for (@array) { push @newarray, expr; } @newarray; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Can this script be Optimized?
by kcott (Archbishop) on May 01, 2014 at 18:51 UTC |