Since I donโt know what you are doing in the line reading loop and donโt understand @docs and @Dir, I will show the code that โworksโ for me:
use strict; use warnings; use English; my $dir = './_tmp/readFID'; foreach my $fp (glob("$dir/*.txt")) { 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"; }
exit:
./_tmp/readFID/123.txt 1 2 3 ./_tmp/readFID/45.txt 4 5 ./_tmp/readFID/678.txt 6 7 8
Perhaps you can find the corresponding difference with your script.
Ekkehard.Horner
source share