$buf = ' '; while($buf) { sysread STDIN, $buf, 1; print "$buf\n" # or whatever else you want # to do with it ;) }