foreach my $handle1 (@read_from) { my $buf = ''; my $rv = sysread($handle1, $buf, 64*1024, length($buf)); # Handle error if !defined($rv) # Handle eof if !$rv print $buf; # Whatever we got, including partial lines }