#!c:\perl\bin\perl.exe -w use strict; use File::Find; #variables my ($directory,$file,$text); print "Enter search text: "; $text = ; chomp $text; $directory = 'c:\my_directory'; find (\&search,$directory); sub search { my $file = $File::Find::name; if (-r $file && -f $file) { open (FILE, "$file") or die "Guess what, it didn't work! $!\n"; while (my $line = ) { print "$text - $file\n" if $line =~ /$text/; } } close FILE; }