in reply to Re: How to access outside variable
in thread How to access outside variable
The variable declared as my.
Rewriting the code
my $a=10; { my $a=11; print $a; }
Please consider the file is not an module. It is just simple .pl file.
I want print value of $a is 10 inside the block which is declared on outside.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to access outside variable
by ELISHEVA (Prior) on Jan 21, 2011 at 06:02 UTC | |
by Anonymous Monk on Jan 21, 2011 at 06:10 UTC | |
|
Re^3: How to access outside variable
by Anonyrnous Monk (Hermit) on Jan 21, 2011 at 11:00 UTC | |
|
Re^3: How to access outside variable
by Anonymous Monk on Jan 21, 2011 at 06:47 UTC |