gopalr has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
$a='main'; if (1) { local $a='sub'; print "\n$a"; print "\n$main::a"; } print "\n$a";
OUTPUT:
sub sub main
Needed OUTPUT:
sub main main
But, When I use my instead of local, I get the correct output.
How can i get the main value when use local.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get the $main value when use local
by polettix (Vicar) on Aug 04, 2005 at 09:10 UTC | |
|
Re: Get the $main value when use local
by Joost (Canon) on Aug 04, 2005 at 09:21 UTC | |
|
Re: Get the $main value when use local
by blazar (Canon) on Aug 04, 2005 at 09:11 UTC | |
|
Re: Get the $main value when use local
by jbrugger (Parson) on Aug 04, 2005 at 09:14 UTC |