Come to think of it:
foreach ( @alist ) { if ( condition( $_ ) ) { do_something( $_ ); } }
can be written as
foreach ( @alist ) { condition( $_ ) and do_something( $_ ) }
Which is as pretty as the map version. The point about worrying too much about memory still stands though.
Have Fun
In reply to Re^3: Confusing syntax error with grep
by gumpu
in thread Confusing syntax error with grep
by gumpu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |