What you're talking about here is specific to the ModPerl::Registry module which is used for running CGI scripts under mod_perl. It does automatically pick up changes in your scripts. If you write an actual mod_perl module instead, you don't have to worry at all about it changing your code or creating nested subs.