Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: multiple loop problem

by eduardo (Curate)
on Apr 28, 2001 at 20:21 UTC ( [id://76387]=note: print w/replies, xml ) Need Help??


in reply to multiple loop problem

Because once the first while loop has run it's course, F is "empty." Think of it like a book, if I say to you, "flip through all the pages in the book," and you finish it, so it's on its back cover, and I say: "Flip through all the pages in the book!" You can't without fliping it over and starting fresh. A:
close(F); open(F, "/etc/passwd");
between the whiles, is the equivalent of flipping the book over so you can flip through the pages again.
seek(F, 0, 0);
does something similar, only it doesn't completely close and reopen the book, think of this as just flipping the pages back to the beginning. I hope it makes sense :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found