No this doesn't help. You're still paying the cost of a function call. And function calls are s-l-o-w in Perl.
I recently encountered a program of which 20% of the run time was being absorbed by a debug() that was being called to do nothing. (postgrey, in case you were wondering).
My solution was to change the code to
debug("foo") if DEBUG;... but only because I was worried about performance. From a readability point of view, it sucks.
True macros would be a nice addition to Perl. I know that there's a Macro module that purports to do just this, but I have never used it.
• another intruder with the mooring in the heart of the Perl
In reply to Re^2: Debug Macro
by grinder
in thread Debug Macro
by Outaspace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |