1 #/usr/bin/perl 2 3 print "Enter filename that contains output of show access ); 5 print "Enter the second file\n"; 6 chomp ($aoutput1 = ); 7 8 open (IN, $aoutput) || die "Couldn't open $aoutput $!"; 9 open (LOG, ">>matches.txt") || die "Couldn't open matches.txt $!"; 10 open (IN1, $aoutput1) || die "Couldn't open $aoutput1 $!"; 11 #Push each line in file 1 that does not get any matches into an array 12 while (){ 13 push @aoutput unless /matches\)$/; 14 } 15 #Push each line in file 2 that does not get any matches into an array 16 while (){ 17 push @aoutput1 unless /matches\)$/; 18 } 19 20 #See if the lines that didn't get matches on day 1 didn't get matches on day 2 as well 21 22 #Gotta be a better way to do this? 23 24 25 while (<@aoutput>){ 26 $linetemp = grep {/$_/i} @aoutput1; 27 if ($_ = $linetemp) { 28 print $_; 29 } 30 }