Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to read every 16 line of file ?

by ikegami (Patriarch)
on May 13, 2011 at 16:31 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-03-28 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found