in reply to Re: use of "use X"
in thread use of "use X"

Have tried a few modifications, but none eliminated the 'redefine' warnings when ($debug > 2).

That's because it has a lexical scope, and the scope in your code is the containing block. This ugly alternative works:

BEGIN { warnings->unimport( 'redefine' ) if $debug > 2 }

Improve your skills with Modern Perl: the free book.