This is what I would do:

I hope that makes sense. Here is some code to demonstrate:

#!/usr/bin/perl -w use strict; my %computers; my $computer; my @required_patches = qw( KB893756 KB893803 KB896422 KB896423 KB899588 KB899591 KB911927 KB921883 ); while (my $line = <DATA>) { chomp($line); if ($line =~ /^KB\d{6}/) { $computers{$computer}{$line}++; } else { $computer = $line; } } for my $patch (@required_patches) { for my $computer (keys %computers) { if (!exists $computers{$computer}{$patch}) { print "$computer is missing patch $patch\n"; } } } __DATA__ Computer1 KB893756 KB896422 KB896423 KB899588 KB899591 KB921883 Computer2 KB893756 KB896422 KB896423 KB899591 KB917159 KB921883 Computer3 KB893756 KB896422 KB899588 KB899591 KB917159 KB921883
Which prints:
Computer3 is missing patch KB893803 Computer2 is missing patch KB893803 Computer1 is missing patch KB893803 Computer3 is missing patch KB896423 Computer2 is missing patch KB899588 Computer3 is missing patch KB911927 Computer2 is missing patch KB911927 Computer1 is missing patch KB911927

Cheers,
Darren :)


In reply to Re: Finding out what computer does NOT have certain data by McDarren
in thread Finding out what computer does NOT have certain data by Sunnmann

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.