Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

RE (tilly) 1: Array mysteriously disappears on loop exit...

by tilly (Archbishop)
on Oct 09, 2000 at 22:49 UTC ( [id://35979]=note: print w/replies, xml ) Need Help??


in reply to Array mysteriously disappears on loop exit...

The my declaration is lexical, so when you return from the function if that code is in another file you could be leaving the scope of that array. Declaring with use vars should solve that.

But that said, using global like this is usually an indicator of poorly factored design. Instead design your code so that you return the array instead of manipulate it. That kind of design tends to be more flexible and ages much better.

  • Comment on RE (tilly) 1: Array mysteriously disappears on loop exit...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-23 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found