Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: passing a file handle to a subroutine

by rhesa (Vicar)
on Sep 04, 2007 at 18:50 UTC ( [id://637002]=note: print w/replies, xml ) Need Help??


in reply to passing a file handle to a subroutine

I recommend using lexical filehandles:
open my $rm3d_fh, '>', $fullFileName or die "...$!"; rm3dHeader( $rm3d_fh ); sub rm3dHeader { my $fh = shift; print $fh "START..."; }
I think that's easier to understand than trying to pass a glob.

Replies are listed 'Best First'.
Re^2: passing a file handle to a subroutine
by kevind0718 (Scribe) on Sep 04, 2007 at 19:15 UTC
    that worked first try.
    many thanks
    kd

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found