![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: Re: inlined DEBUG constant versus $DEBUGby stefp (Vicar) |
on Sep 19, 2001 at 18:23 UTC ( [id://113349]=note: print w/replies, xml ) | Need Help?? |
I never claimed significant speed improvement.
What I had in mind is debugging thru the perl debugger.
In that case the print statement becomes noise.
I don't want anything to print, I even don't want to
bother to go thru the statement that contains the print.
Oddly, with use constant DEBUG => 0 I indeed step
thru the statement that contains the print: print "whatever\n" if DEBUG. Worse I also step thru one line of constant.pm! With sub DEBUG() { 0 } I still step thru the statement that contains the print. When debugging one goes from one nextstate opcode to the next. We see that consecutive nextstate statements are not fusionned as I expected them to be: Both oneliners give me the same tree: perl -e ' sub DEBUG() { 0 } ; use O qw( Concise -exec); print "toto" if DEBUG; print "toto" if DEBUG'
I don't understand how I get thru one line of constant.pm when debugging using constants!!! I tested using perl 5.6.1 -- stefp
In Section
Meditations
|
|