in reply to Usage of grep on a file
Probably you want to combine Regexp::Assemble with inplace edit and do something like:
use Regexp::Assemble; my $ra = Regexp::Assemble->new; $ra->add ($_) for @matchArray; my $re = $ra->re; @ARGV = ('filename'); $^I = '.bak'; while (<>) { print if m/$re/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Usage of grep on a file
by tsk1979 (Scribe) on Apr 07, 2006 at 07:30 UTC | |
by GrandFather (Saint) on Apr 07, 2006 at 07:37 UTC | |
by parv (Parson) on Apr 07, 2006 at 07:34 UTC |