in reply to read data 1 byte at a time

Sysread returns 0 at the end of the file.

open(AFILE, "<a.pl"); my $byte; while (sysread(AFILE, $byte, 1)) { print $byte; } close(AFILE);