I tried perl -p "*.*" -e "print $_ if /regex/" and it's complaining about the *.*.
Aye, that's because you've got it in the wrong place. It looks like you want:
perl -ne "print if /regex/" *.*or maybe
perl -pe "next unless /regex/" *.*Though I'm not sure about the globbing under windows. I seem to recall that each program must do its own. Perhaps what you really need is this:
perl -ne "BEGIN { @ARGV = glob(qq(@ARGV)); } print if /regex/" "*.*"
caveat lector! this code is untested.
In reply to Re: Perl as grep
by duff
in thread Perl as grep
by ibanix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |