Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Hmmm: while(), file handle and $_ gotcha

by ikegami (Patriarch)
on Mar 06, 2009 at 16:15 UTC ( [id://748904]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Hmmm: while(), file handle and $_ gotcha
in thread Hmmm: while(), file handle and $_ gotcha

Since we want to print the first 5 lines of each group of 10,
while (<DATA>) { print if ($. - 1) % 10 < 5; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found