I want to read a file from a directory folder [duplicate]

Use the diamond operator to read from an opened file handle:

open my $FH, '<', '/path/to/spool.txt' or die $!;
while (my $line = <$FH>) {
    print "I've read: $line";
}
close $FH;

Browse More Popular Posts

Leave a Comment