Front page | perl.beginners |
Postings from May 2012
Re: Perl preprocessor
Thread Previous
|
Thread Next
From:
Paul Johnson
Date:
May 4, 2012 11:27
Subject:
Re: Perl preprocessor
Message ID:
20120504182736.GM414@pjcj.net
On Fri, May 04, 2012 at 08:16:01PM +0200, Manfred Lotz wrote:
> Hi there,
> I'm looking for a Perl preprocessor which should roughly be able to
> work like this:
>
> In a document I have begin and end markers, say ## for both. Between
> those end markers there is perl code which should be run and everything
> which goes to stdout should go into the document.
>
> The code should be lexical in a way that later code could refer to
> previous code.
>
> Primitive example:
>
> This is a sample document.
> ## my $name = 'Manfred Lotz'; ##
> My name is ## print $name; ## and I'm from Germany.
>
> should result in the following document:
>
> This is a sample document.
> My name is Manfred Lotz and I'm from Germany.
>
>
> Does anybody know about a module which could do this?
That sounds like something that Mason could do. And I expect there are
a number of other modules on CPAN that could also manage that. But take
a look at https://metacpan.org/module/Mason
Good luck,
--
Paul Johnson - paul@pjcj.net
http://www.pjcj.net
Thread Previous
|
Thread Next