Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
perlfunc:grepby gods (Initiate) |
on Aug 24, 1999 at 22:42 UTC ( [id://267]=perlfunc: print w/replies, xml ) | Need Help?? |
grepSee the current Perl documentation for grep. Here is our local, out-dated (pre-5.6) version: grep - locate elements in a list test true against a given criterion
grep BLOCK LIST grep EXPR,LIST
This is similar in spirit to, but not the same as,
Evaluates the
BLOCK or
EXPR for each element of
LIST (locally setting
@foo = grep(!/^#/, @bar); # weed out comments or equivalently,
@foo = grep {!/^#/} @bar; # weed out comments
Note that, because See also map for an array composed of the results of the BLOCK or EXPR. |
|