in reply to find common lines in many files

Is this what you want?
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;