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.
In reply to Re^2: How to access outside variable
by Anonymous Monk
in thread How to access outside variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |