in reply to a problem with a filehandle reference
You could also create the same sort of thing with Filehandle or with the following code.use IO::File (); # assuming LOCK_FILE is a constant with the filename my $fh = IO::File->new( LOCK_FILE, 'w' ); # now you can pass $fh directly to your sub # as in code_lock( $fh ); # sub code_lock { my $fh = shift(); }
use Symbol(); my $fh = Symbol::gensym(); open($fh,">".LOCK_FILE); # pass it as in the above
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: a problem with a filehandle reference
by plazm (Initiate) on Apr 19, 2001 at 23:43 UTC | |
by Rhandom (Curate) on Apr 20, 2001 at 00:00 UTC |