use strict; use warnings; use English; my $dir = 'F:'; foreach my $fp (glob("$dir/*.pl")) { printf "%s\n", $fp; open my $fh, "<", $fp or die "can't read open '$fp': $OS_ERROR"; while (<$fh>) { printf " %s", $_; } close $fh or die "can't read close '$fp': $OS_ERROR"; }