in reply to best way to inline code? (i.e. macro)

I know nothing about mod_perl. Nothing at all! But...

Beyond that, if you really need a macro facility, there are several possibilities:

  1. The highly deprecated and discouraged -P option (see perlrun)

    This probably wouldn't work with mod_perl?

  2. The alternative to -P mentioned in perlrun, Filter::cpp.
  3. The universally disliked possibility of a custom source filter using Filter::Simple or Filter::Util::call packages.
  4. Using a preprocessor as a part of your "build" process. That could be the C preprocessor or a dedicated tool like m4.

Note: I'm not recommending you use any of these--indeed, from what information you've posted it is hard to see how a macro facility would benefit you in any significant way--but it is good to have the information available even if only that you can make your own mind up with good conscience.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.