Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: passing file handle to functions

by ioannis (Abbot)
on May 18, 2006 at 07:13 UTC ( [id://550174]=note: print w/replies, xml ) Need Help??


in reply to passing file handle to functions

If you pass a glob, you can pass both the filehandle and the array with one stone -- the filehandle can always be reopened:
no strict 'vars'; use Fatal qw(open); open local(*KERLIS) , $file; @KERLIS = <I>; close KERLIS; passboth( *KERLIS ); sub passboth { local *FH = shift; # print @FH; # open *FH, $file; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found