Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

(Ovid - seek)Re: Closing and re-opening the DATA Filehandle

by Ovid (Cardinal)
on Apr 04, 2001 at 23:11 UTC ( [id://69808]=note: print w/replies, xml ) Need Help??


in reply to Closing and re-opening the DATA Filehandle

Rather than opening and closing the file, how about opening it once and using seek DATA, 0, 0 to reposition yourself at the start of __DATA__? Anyone see a problem with this approach?

Cheers,
Ovid

Update: Oops. I keep forgetting that __DATA__ doesn't behave like a normal filehandle. See tye's answer below.

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid - seek)Re: Closing and re-opening the DATA Filehandle
by Adam (Vicar) on Apr 04, 2001 at 23:15 UTC
    0, 0 is not the position of __DATA__, its the begining of the file.

    Also, seek still leaves the filehandle attached to error messages, which I don't want.

Log In?
Username:
Password:

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

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

    No recent polls found