in reply to Persistent Variable
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.