in reply to returning filehandles
This is a little inconvenient if I want to use this handle everywhere. Which leads me to a scoping question. Since I declared my *bighandle; at the global level, will *bighandle be visible in useafile even if I don't pass it in? How do you force a variable to be global?my *bighandle = openafile(); useafile(*bighandle); sub openafile { local *handle; open handle, "file" or die; return *handle; } sub useafile { local *handle = shift; # do stuff with *handle }
Thanks again
Some people drink from the fountain of knowledge, others just gargle.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: returning filehandles
by chipmunk (Parson) on Jan 31, 2001 at 02:06 UTC | |
Re: Re: returning filehandles
by arturo (Vicar) on Jan 31, 2001 at 02:05 UTC |