Perl-Sensitive Sunglasses | |
PerlMonks |
Re: How to access a variable inside subroutine?by jeffenstein (Hermit) |
on Sep 05, 2020 at 19:03 UTC ( [id://11121381]=note: print w/replies, xml ) | Need Help?? |
Hello Pritesh, Even though the variable is static, it is still only visible within the block where it was declared. In your example, the variable still exists, but inaccessible from outside the counter subroutine Hope this helps.
In Section
Seekers of Perl Wisdom
|
|