in reply to I need "Antigrep"
my $pattern = shift(@ARGV); my $re = qr/$pattern/; FILE: foreach my $filename (@ARGV) { open(my $fh, '<', $filename) or do { warn("Unable to open $filename: $!\n"); next; }; while (<$fh>) { next FILE if /$re/; } print("$filename\n"); }
Updated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I need "Antigrep"
by tphyahoo (Vicar) on Aug 15, 2006 at 18:06 UTC | |
by ikegami (Patriarch) on Aug 15, 2006 at 18:12 UTC |