Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how do i reset a filehandle?

by lhoward (Vicar)
on Jun 01, 2000 at 01:00 UTC ( [id://15709]=note: print w/replies, xml ) Need Help??


in reply to how do i reset a filehandle?

Use the seek command.
seek HANDLE,0,0;
you mileage may vary if trying to seek on streams or pipes (like STDIN).

Replies are listed 'Best First'.
RE: Re: how do i reset a filehandle?
by Zoogie (Curate) on Jun 01, 2000 at 07:10 UTC
    Just to clarify lhoward's answer:
    The second parameter for seek is a position, the third parameter is what the position is relative to:

    0 Relative to the beginning of the file.
    1 Relative to the current position.
    2 Relative to the end of the file.

    So,

      seek HANDLE,0,0
    
    means to move to index 0 relative to the beginning of the file.
RE: Re: how do i reset a filehandle?
by Zoogie (Curate) on Jun 01, 2000 at 07:11 UTC
    Just to clarify lhoward's answer:
    The second parameter for seek is a position, the third parameter is what the position is relative to:

    0 Relative to the beginning of the file.
    1 Relative to the current position.
    2 Relative to the end of the file.

    So,

      seek HANDLE,0,0
    
    means to move to index 0 relative to the beginning of the file.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://15709]
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-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found