in reply to Perl Variables Being Retained

What tobyink said, and here are tutorials to teach you about scoping and persistence, read them all, try them out, become a better programmer

Read Tutorials: Simple Module Tutorial, Variable Scoping in Perl: the basics, Coping with Scoping , Mini-Tutorial: Perl's Memory Management, Lexical scoping like a fox, Of Symbol Tables and Globs, CGI to mod_perl Porting. mod_perl Coding guidelines