Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine

by chuckbutler (Vicar)
on Apr 07, 2010 at 04:19 UTC ( #833180=note: print w/ replies, xml ) Need Help??


in reply to Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine

LA:

@classes and %classes are declared at the top lex level of the package, so they with not go out of scope until the program exits. When it is appropriate, within a routine in the package, you can:

... @classes = (); %classes = (); ...

to empty them.

Good luck. -c


Comment on Re: Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (16)
As of 2015-07-29 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls