in reply to regex and sysread
sysread() is for reading binary data and you don't want buffering etc. to get in the way.
If you just want to read lines of text, use a simpler form such as
open($fh, $fname) || die $!; while (my $line = <$fh>) { # Do something with each $line... } close $fh;
|
|---|