in reply to Re: Re: [OT?] Today's Debugging Story
in thread [OT?] Today's Debugging Story

Using a constant is better if you don't need to switch the value at runtime:
$ perl -MO=Deparse,-x7 -le'use constant DEBUG => 0; print "test" if DE +BUG' sub DEBUG () { package constant; $scalar; } '???'; -e syntax OK
In other words, by using constants all of the debugging code is entirely removed from "production run mode". It's advisable because you avoid both the cost at runtime and (more importantly) can more reliably make sure you don't rely on any debugging code side effects. ("What? I can't initialize variables in an assert()?" :^) )

Makeshifts last the longest.