in reply to BEGIN { } block

The Poor Man's Grep: for use on Windows when you have Perl but not grep(1).

perl -nle "BEGIN{@ARGV=map{glob}@ARGV}/PATTERN/&&print" <files> ...

Replace PATTERN with the pattern you want to find.

Here, the BEGIN{} is used to convert any wildcards in the <files> into real file names.

Replies are listed 'Best First'.
Re^2: BEGIN { } block
by dolmen (Beadle) on Aug 11, 2009 at 15:54 UTC
    The poor man's grep on Windows is findstr.
      Or grep, or ack (designed as a replacement for 99% of the uses of grep).