our $Debug=0; # lots of subs that work sub doesnt_work_quite_right { local $Debug=1; # code that we are trying to debug } #### my $Debug; sub doesnt_work_quite_right { my $olddebug=$Debug; $Debug=1; # code that we are trying to debug $Debug=$olddebug; }