my %common; my ($first, @files) = @ARGV; @common{ do { local @ARGV = ($first); <> } } = (); for my $file (@files) { my %this; local @ARGV = ($file); @this{ grep exists $common{$_}, <> } = (); delete @common{ grep ! exists $this{$_}, keys %common}; } print keys %common if keys %common;
In reply to Re: find common lines in many files
by happy.barney
in thread find common lines in many files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |