Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: passing file handle to functions

by ioannis (Monsignor)
on May 18, 2006 at 07:13 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://550174]
[Corion]: Hi marto!
[Corion]: I hope you were able to catch up on some sleep
Corion is slowly, slowly relaxing. Yesterday I spent vegging out in front of the PC, today at a friends, and hopefully I have the books for our Perl club done by Monday. I guess I'll only really relax once I get back from LPW
[marto]: last night, well this morning was a 5am finish, up from 4 am the previous day. Oddly I feel better today than I did yesterday
[Corion]: marto: I think the first thing sleep deprivation does is kill your sense of how tired you are :)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-11-19 11:25 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (280 votes). Check out past polls.