Eduardo Vázquez Rodríguez wrote:
Hello

Hello,

I am writing scripts that process big files which contains too many lines (aproximately 700 000 lines per file). My strategy until now to solve this problem is reading line per line, something like this

while (<FILE>)
{
   dosomethingwith($_);
}

Is there any way of working with multiple lines at the same time? can anyone suggest any better strategy?

You could change the input record separator.

local $/ = '';  # read a paragraph at a time
while ( <FILE> ) {


local $/ = \32_768; # read 32,768 bytes at a time while ( <FILE> ) {


perldoc perlvar



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to