in reply to Need advice (module) to parse nested IF/ELSIF..

Sounds like you're writing a templating system. Maybe you should look at existing ones, like Template Toolkit, HTML::Template, Text::Template, Excel::Template, PDF::Template, etc.

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re: Need advice (module) to parse nested IF/ELSIF..

Replies are listed 'Best First'.
Re: Re: Need advice (module) to parse nested IF/ELSIF..
by bmann (Priest) on Jan 28, 2004 at 18:54 UTC
    Sounds like you're writing a templating system

    Clippy, is that you? ;-)

    Seriously though, I'd second the Template Toolkit recommendation. You (the original poster) can use the START_TAG and END_TAG config options to set the start and end tags to "<%" and "%>", then just process the template.

    Here is the example from tt2's Config documentation:

    my $template = Template->new({ START_TAG => quotemeta('<+'), END_TAG => quotemeta('+>'), });
Re: Re: Need advice (module) to parse nested IF/ELSIF..
by Anonymous Monk on Jan 28, 2004 at 23:05 UTC
    Thanks to all for all the hints. I found the ScriptTemplate which possibly can do what I need.

    Best Regards
    Tai