[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-AnyPerl] Reset File



Is there a 'reset' file command, or option for OPEN in Perl, or do you need
to CLOSE and OPEN the file again if you wish to read it line-by-line from
the beginning?

I need to count the number of occurrences of a string in a file first,
before I can process the files contents, so I need to be able to 'point' to
the beginning of the file after I have reached the EOF.

In looking through the Camel book, it appears that the 'seek' function would
be the way to do this:

seek FILEHANDLE,0,0;

Mark
----------------------
Mark J. Yannuzzi
myannuzzi@aya.yale.edu

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org