in reply to Search and delete lines based on string matching
Sounds like you're trying to reimplement fgrep -v -F.
Here's a quick-and-dirty:
use Getopt::Long; GetOptions( 'file=s' => \my $patfile ); chomp( my @del = do { local @ARGV = ($patfile); <> } ); my %del; @del{ @del } = (); $, = $\ = $/; print grep { chomp; not exists $del{$_} } <>;
call it like so:
perl this_script.pl -f A < B > C
(given A, B, C, per your root post)
|
|---|