# 5 0 5 0 5 7 $p=shift;print grep/$p/,<>;
and works for any number of files as well as STDIN
However, the content of all the files will be "slurped" into memory because <> is in list context.
To read line by line:
# 5 0 5 0 5 0 2 $p=shift;while(<>){print if/$p/}
In reply to Re: perl grep clone
by RonW
in thread perl grep clone
by pythondude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |