# this feels closer to Perl-like read with extra functionality $n_chars = read $fh, $buf, "4k"; # this is another option, but involves more typing @lines = tied(%{$fh})->getlines(500);