in reply to Grabbing lines three-by-three from a file
For example, cutting and pasting and altering slightly:
Change the 10 to 3 and you're nearly done.my @buffer; { push @buffer, scalar <IN>; redo unless eof(IN) or @buffer >= 10; ## process @buffer shift @buffer;## [was:] @buffer = (); redo unless eof(IN); }
-- Randal L. Schwartz, Perl hacker
|
---|