while (read(FH, $buf, 512)) { do something; }