in reply to find common lines in many files
Call it with the list of file names you want to find common lines in.#!/usr/bin/perl use strict; use warnings; exit unless @ARGV; my %cache = do {local @ARGV = shift @ARGV; map {($_, 1)} <>}; while (@ARGV) { local @ARGV = shift @ARGV; %cache = map {$cache{$_} ? ($_, 1) : ()} <>; } print for keys %cache; __END__
|
|---|