Re: Comparing items from multiple files

John Douglas Porter <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
Maybe it would be easier to invert the levels of the hash:



my $re = shift;
my @f = @ARGV;
my %h;
/$re/ and $h{$1}{$ARGV}++ while <>;
for my $s ( keys %h ) {
  print "'$s' in ("@{[ keys %{$h{$s}} ]}),",
    " not (@{[ grep { not exists $h{$s}{$_} } @f ]})\n";
}


-- 
John Douglas Porter


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.