my $flag; my $x = 1; print "Tell me dude/dudette where are the log files: " , " \n"; $Location1 = ; chomp $Location1; print "And where would you like to put the processed results: " , "\n"; $Location2 = ; chomp $Location2; $UserInputDir = $Location1; opendir DH, $UserInputDir or die "Cannot open $UserInputDir: $!"; @files = readdir DH; closedir DH; foreach $file (@files) { next if $file=~/^\./; print "creating hash for $file....\n"; %filehash.$x = &filetohash($file); $x++; } sub filetohash { my $counter; my $file = shift; my %filehash; open(FILE, "< $file") || die $!; while () { chomp $_; s/^ *//; s/ *$//; $filehash{$_} = 1; $counter++; } print "counted $counter lines for file $dir\n"; return %filehash; }