Hiya routedude,
I added <code> tags around your example code, and tweaked some to make it clearer to my short-bus brain.   I found this syntax for matching-the-intersection-of-two-arrays on page 106 of The Perl Cookbook, and also moved the file opens/closes as close to each ofther as possible - always a good habit.
 
Anyways, I *think* this will do what you want or at least be close.   Wiser monks than I might show how to make it scale to more than just two days' acl log files.   The 'while... push unless /matches/' chunks could likely become a subroutine, but as is, this maybe shows some direction.
  cheers,
  ybiC
    striving toward Perl Adept
    (it's pronounced "why-bick")

==untested==
#/usr/bin/perl -w use strict; # define output+input filenames: my $outFile = 'aclLog.txt'; print "Enter filename that contains output of show access <list\n"; chomp my $aclMatchesDay2 = <STDIN>; print "Enter the second file\n"; chomp my $aclMatchesDay2 = <STDIN>; # check for no-matches in first input file: open (ACLM1, $aclMatchesDay1) or die "Couldn't open $aclMatchesDay1: $ +!"; while (<ACLM1>){ push @noMatchesDay1 unless /matches/; } close ACLM1 or die "Couldn't close $aclMatchesDay1: $!"; # check for no-matches in second input file: open (ACLM2, $aclMatchesDay2) or die "Couldn't open $aclMatchesDay2: $ +!"; while (<ACLM2>){ push @noMatchesDay2 unless /matches/; } close ACLM2 or die "Couldn't close $aclMatchesDay2: $!"; # check for overlap betwixt two input files: my %isect; foreach $e (@noMatchesDay1, @noMatchesDay2){ $isect{$e}++; } my $noMatchesEver = keys %isect; # print said overlap to output file: open (OUT, ">>$outFile") or die "Couldn't open $outFile: $!"; print "$_\n" for @noMatchesEver; close OUT or die "Couldn't close $$outFile: $!";

In reply to Re: Parsing cisco router command output (potential answer, untested) by ybiC
in thread Parsing cisco router command output by routedude

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.