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__
In reply to Re: find common lines in many files
by JavaFan
in thread find common lines in many files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |