sub edits() { if ( -f and /^Khlog.08$/ ) { foreach ( $File::Find::name ) { open(LOG, "< $File::Find::name") or die "Could not open file $_: $!"; while ( ) { my $LINE = $_; if ( $LINE =~ m/002389983/ ) { print "Looking for: 002389983\n Found it in file: $LINE\n"; if ( $LINE =~ m/29994339499/ ) { print "Looking for: 29994339499\n Found it in file: $LINE\n"; } else { print "Could not find the second string: 29994339499\n"; } } } } }