in reply to Re^2: split one file into many on finding a new line
in thread split one file into many on finding a new line
The DATA filehandle is special; it reads from whatever comes after a __DATA__ line in your program. If you want to read from the file specified by $filename instead, you have to open it specifically.
open my $filehandle, '<', $filename or die "Can't read '$filename': $!"; while ( <$filehandle> ) { # etc. } close $filehandle or die "Fail on close '$filename': $!";
|
|---|