in reply to Re: Re: [OT?] Today's Debugging Story
in thread [OT?] Today's Debugging Story
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()?" :^) )$ perl -MO=Deparse,-x7 -le'use constant DEBUG => 0; print "test" if DE +BUG' sub DEBUG () { package constant; $scalar; } '???'; -e syntax OK
Makeshifts last the longest.
|
|---|