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

[MacPerl-AnyPerl] Reset File



Mark Yannuzzi writes:
 > 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?
 > 
 > seek FILEHANDLE,0,0;

You appear to have answered your own question.  However, the following 
is more readable:

	seek FILEHANDLE, 0, SEEK_SET;

Other options are SEEK_CUR (from current position) and SEEK_END (from
EOF, usually negative.)

-- 
Jacob Kenner, Systems Engineer		Milk -- where's your mustache?
jacob@chaos.wustl.edu
-No matter whose views these are, I shall not be held liable for any of them.-

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