in reply to Debugging in packages
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: Debugging in packages
by RayRay459 (Pilgrim) on Jul 18, 2001 at 01:36 UTC |