Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My code works for anything needing the handle within the sub, but I would like to have the original handle changed as well so that the reference returned by new_handle() is available to the rest of the program--especially to the original caller of my_sub. Does that make sense? I don't have access to code where my_sub is called.sub my_sub{ my $handle = shift; if (handle_not_valid($handle)){ $handle = new_handle(); } ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing value passed to sub
by Zaxo (Archbishop) on Sep 25, 2004 at 00:18 UTC | |
|
Re: Changing value passed to sub
by Prior Nacre V (Hermit) on Sep 25, 2004 at 05:11 UTC | |
|
Re: Changing value passed to sub
by johnnywang (Priest) on Sep 25, 2004 at 00:56 UTC | |
|
Re: Changing value passed to sub
by TedPride (Priest) on Sep 25, 2004 at 09:10 UTC |