in reply to Reading input byte by byte
Actually, you're telling it to read one byte at at time, until there's nothing left (read returns the number of bytes it succeeded in reading -- when there are none left, it will return 0, and your while loop will stop):
while(read (TEST, $stuff, 1)) {
...and then you're appending what you read during this pass onto what you've already read, until $text contains everything in the file:
$text .= $stuff;
....and then you're printing out the whole thing:
print $text;
If you only want to read 1 byte and then stop, you probably don't want to put it in a while loop.
Linda
|
|---|