in reply to read multiple files
I wasn't sure from your question whether you wanted to eliminate duplicate lines from files or not, and if so, dups that appeared only in all files, or just multiple files. That exercise is left to the user...use strict; use warnings; my @files = `ls *.txt`; my %filedata; foreach my $file (@files) open (CUR, $file) || die "could not open $file: $!"; my @lines = <CUR>; $filedata{$file} = \@lines; close CUR; }
|
|---|