Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Grabbing lines three-by-three from a file

by merlyn (Sage)
on Dec 11, 2001 at 02:10 UTC ( [id://130794]=note: print w/replies, xml ) Need Help??


in reply to Grabbing lines three-by-three from a file

A variation of this is answered in "Re: Reading multiple lines?". Maybe that technique could be of use.

For example, cutting and pasting and altering slightly:

my @buffer; { push @buffer, scalar <IN>; redo unless eof(IN) or @buffer >= 10; ## process @buffer shift @buffer;## [was:] @buffer = (); redo unless eof(IN); }
Change the 10 to 3 and you're nearly done.

-- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://130794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2026-02-08 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.