# from Programming Perl my $buffer; while ( read $your_handle, $buffer, 1024 ) { # process buffer here }