in reply to mod_perl with Apache::Registry with CGI.pm design considerations

I tried to explain this in my replies to both of your previous posts, but maybe I didn't put it clearly enough: your variables hold their values between requests because you are creating closures. You create a closure any time you run code under Apache::Registry that looks this:
my $foo = $query->param('foo'); bar(); sub bar { print $foo; }
Now you will never be able to change the value of $foo for that bar() sub.

It's easy to prevent this. You can pass the values to your subs:

my $foo = $query->param('foo'); bar($foo); sub bar { my $foo = shift; print $foo; }
In addition to avoiding closures, it's simply a better programming practice. it improves abstraction and makes your code more robust. You could also put your subs in a separate module (a real module with a package name, not just a "require lib.pl" thing), which would force you to pass values to your subs.