I'm looking to find common lines between two files (mail.fil) and (THIDSerrs). I then want to eliminate the common lines from the one file, mail.fil.
#!/usr/local/perl-5.12.3/bin/perl use strict; use warnings; open FILE,"< mail.fil"; my @oralines=<FILE>; close FILE; #print @oralines; open FILE,"<THIDSerrs"; my @errs = <FILE>; close FILE; #print @errs; my @subarray = (); foreach my $oralines(@oralines) { foreach my $errs(@errs) { push @subarray, $oralines if grep /$errs/, @oralines; } } print "@subarray \n";
Hope this is more readable - I'm new at this.
In reply to Re: use to files - grep one to eliminate entries from another file.
by newkendall
in thread use to files - grep one to eliminate entries from another file.
by newkendall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |