Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to read every 16 line of file ?

by ikegami (Patriarch)
on May 13, 2011 at 16:31 UTC ( #904696=note: print w/replies, xml ) Need Help??


in reply to How to read every 16 line of file ?

If I misunderstood and you are trying to get blocks of 16 lines,

my @buf; while (<>) { push @buf, $_; if (@buf == 16) { do_it(\@buf); @buf = (); } } if (@buf) { do_it(\@buf); }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2022-08-08 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?