karl williamson <public@khwilliamson.com> writes: > Based on looking at existing code in utf8_heavy.pl, I had presumed > that the Perl optimizer would remove code that depended on a constant > subroutine that returns false. That is, 'foo if DEBUG' would be > optimized away if there was a line: 'sub Debug { 0 }' But that > appears to not be the case. It needs a prototype: 'sub Debug () { 0 }'. From perlsub: # Functions with a prototype of "()" are potential candidates for # inlining. If the result after optimization and constant folding is # either a constant or a lexically‐scoped scalar which has no other # references, then it will be used in place of function calls made # without "&". Calls made using "&" are never inlined. (See # constant.pm for an easy way to declare most constants.) Eirik -- All bridge hands are equally likely, but some are more equally likely than others. -- Alan TruscottThread Previous | Thread Next