c:\>perl -nle"push @{$h{$_}},$ARGV}{print qq[$_ found in @{$h{$_}}] for keys %h" 0.dat 1.dat 2.dat 3.dat 4.dat 5.dat 6.dat 7.dat 8.dat 9.dat