open( P, "<", "Two.txt" ) or die "Two.txt: $!"; my @patches = sort

; chomp @patches; close P; my %patch_id; my $seq_num = 0; $patch_id{$_} = $seq_num++ for ( @patches ); #### my %comp_patch; # will be a hash of arrays my $comp_name; # will store most recently seen computer name open( C, "<", "One.log" ) or die "One.log: $!"; while () { chomp; if ( /^KB\d+/ ) { # this is a patch name if ( not exists( $patch_id{$_} )) { warn "Computer $comp_name has unknown patch: $_\n"; next; # (might want to do something else here) } $comp_patch{$comp_name}[$patch_id{$_}] = $_; } elsif ( /^\S+/ ) { # not a patch name, must be a computer name $comp_name = $_; } } #### for my $cname ( sort keys %comp_patch ) { for my $pnum ( 0 .. $#patches ) { print "$cname lacks $patches[$pnum]\n" unless ( defined( $comp_patch{$cname}[$pnum] )); } }