in reply to Re: Interpolate Perl variables in POD
in thread Interpolate Perl variables in POD

OK. But could there be a way to instruct the POD modules with a directive to substitute when it sees X<subst:keyword123> in POD? Maybe up front:
use Pod::Subst qw(keyword123 replacement456)

so that pod2usage() knows what to do. No Perl parsing need be involved.

Thanks for the replies!

Replies are listed 'Best First'.
Re^3: Interpolate Perl variables in POD
by GrandFather (Saint) on Oct 01, 2008 at 01:11 UTC

    You could post process the output from pod2usage() to do the substitutions. It would be smart to use a form of markup that is unlikely to be changed by the pod2usage() processing.

    Alternatively, you could preprocess the input to pod2usage() with the same caveat.


    Perl reduces RSI - it saves typing
      Ahhh. How would I post-process pod2usage() output before, say, it gets put out as a man page?

        I'd use Perl. Some variation on:

        use strict; use warnings; while (<>) { s/this/that/g; print; }

        Perl reduces RSI - it saves typing