Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
There's more than one way to do things
 
PerlMonks  

Re: Closing and re-opening the DATA Filehandle

by Adam (Vicar)
on Apr 04, 2001 at 22:22 UTC ( [id://69923]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Closing and re-opening the DATA Filehandle

HA! I figured it out!

This works, and no filehandles in the error messages:

my @Table; sub LoadTable { local( $/, $. ); my $position = tell( DATA ); @Table = map {chomp; hex} split ' ', <DATA>; seek DATA, $position, 0; # Reset the filehandle, rather then closi +ng it. # Never close DATA. }
But if I take $. out of the local line, then the filehandle shows up in the error messages. Thanks all!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://69923]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.