Here's an idea:
sub say { print "$_[0]\n"; } sub moan { print STDERR "WARNING: $_[0]\n"; } sub mutter { print "debug: $_[0]\n"; } if (!$DEBUG) { eval "sub mutter { }"; }
Then the code reads well too :-)
In reply to Re: inlined DEBUG constant versus $DEBUG
by mugwumpjism
in thread inlined DEBUG constant versus $DEBUG
by stefp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |