You can do something like:
and Perl will optimize away your debug code when it is compiled if debugging is not enabled. Just another way... - tye (but my friends call me "Tye")package My::WunderCode; BEGIN { if( $ENV{DEBUG_MY_WUNDERCODE} ) { eval "sub debug() { !1 }"; } else { eval "sub debug() { 1 }"; } die $@ if $@; } warn "Debugging ",__PACKAGE__,"...\n" if debug;
In reply to (tye)Re: Debugging in packages
by tye
in thread Debugging in packages
by agoth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |