in reply to Persistent Variable

You can go about it two ways.

You can declare the variable global ( using use vars qw ($variable); ) ( I assume you use strict ).

you can access this in any package with $::variable if you declared it in main package ( i.e no declared package) , or $packagename::variable where packagename is the package you declared the variable in.

The second way is to use 00 perl and closures. This is the way to go if you want to have maintainable code. The definitive book on this is Damion Conway's "Object Oriented Perl". See page 56. The concept is subtle, and you have to read it a few times , even from an author as gifted as Damien.

There is an excerpt of the book here. but it does not cover using closures for persistence.

Here is an example of a closure without OO programming