http://qs321.pair.com?node_id=557507


in reply to Re: grep -P
in thread grep -P

I guess -R (recurse directory) and -l (print filenames containing matches) are two that I use often. The one liner is a bit of a mouthful.

But just for fun:

perl -MFile::Find -ne 'find(& sub { $f = 1; if (/pat/ and $f) { $f = 0 +; print $File::Find::name . "\n" }, "mydir");'

...or something like that.

-Andrew.