in reply to Re^4: How to compare 3 lists
in thread How to compare 3 lists
$isok = 1; for $logname("logfile1", "logfile2", "logfile3") { open FH, $logname ...; @isthisfileok=(0)x 6; while(<FH>) { $isthisfileok[$1]++ if /^snapshot([1-6])/; # last if /^snapshot([7-9]|\d{2,})/; # are snapshots sorted numeri +cally? then you don't have to search whole file if found snapshot7 or + other } close FH; $somesnapshotnotfound = grep $_ == 0, @isthisfileok; $isok = 0 if !$somesnapshotnotfound; last if !$isok; # don't scan another file if already not ok } print "everything ok" if $isok;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to compare 3 lists
by shammow (Novice) on Oct 26, 2012 at 13:13 UTC | |
by grizzley (Chaplain) on Oct 26, 2012 at 13:56 UTC | |
by shammow (Novice) on Oct 26, 2012 at 14:51 UTC |