Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Does Scope of Referenced Array Matter?

by tangent (Priest)
on Feb 19, 2012 at 22:37 UTC ( #954932=note: print w/replies, xml ) Need Help??


in reply to Does Scope of Referenced Array Matter?

Your array is declared using the 'my' keyword but your $array_ref isn't, it is acting as a global variable (something you may not want). It will keep the array alive until it (the reference) goes out of scope, which in this case is when your program ends. If you use strict in your program it will tell you:
Global symbol "$array_ref" requires explicit package name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://954932]
help
Chatterbox?
robby_dobby adds fortune cookies to the platter on the sideboard.
robby_dobby adds raisin cookies to the platter on the sideboard.
robby_dobby takes a handful of cookies from the platter on the sideboard.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-04-26 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (477 votes). Check out past polls.