A (non-portable) option is to invoke CPP by using -P, as documented in perlrun.
#!/usr/bin/perl -P use constant DEBUG => 0; sub _debug { print $_[0]; } #define debug(s) _debug(s) if DEBUG debug("test\n");
The docs say "A -P on a #! line doesn't work.", but it worked on my system.
The docs say "The #! line is stripped, so any switches there don't apply.", but they worked on my system.
In reply to Re: Optimize debugging subs
by ikegami
in thread Optimize debugging subs
by danb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |