Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How to access a variable inside subroutine?

by jeffenstein (Friar)
on Sep 05, 2020 at 19:03 UTC ( #11121381=note: print w/replies, xml ) Need Help??


in reply to How to access a variable inside subroutine?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11121381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-04-22 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?