Thursday, July 30, 2009

In PERL, how can I reset the cursor position when reading a file?

After reading all the lines in a file, I want to go back to the top line of the file. How can I do this?

In PERL, how can I reset the cursor position when reading a file?
seek(FILE, $pos, 0)?
Reply:close and reopen the file. your EOF pointer will reset.
Reply:use seek


No comments:

Post a Comment