in reply to Re: html template in a perl script
in thread html template in a perl script

cees , can you provide anymore info on the DATA method? I use HTML::Template, but sometimes it's overkill. It sounds like this might be simpler/faster/easier.


Replies are listed 'Best First'.
3Re: html template in a perl script
by jeffa (Bishop) on Sep 21, 2003 at 15:56 UTC
    Um, the DATA method is what we are talking about! You just put your template in the DATA section of your Perl script. I use this all the time for simple CGI scripts and examples i post here at the Monastery - but for anything serious, i use another file for the template. As for your overkill problem, the more you use HTML::Template the less the overkill seems to be a problem.

    As for your problem at Re: html template in a perl script, have you looked into Template yet? Kake Pugh has an excellent article over at How to Avoid Writing Code that demonstrates how well that Class::DBI works with Template Toolkit.


    (the triplet paradiddle with high-hat)
Re: Re: Re: html template in a perl script
by cees (Curate) on Sep 21, 2003 at 16:08 UTC

    If you read the original question again, you will see what the DATA method that I am talking about refers to. It is a method for adding a __DATA__ section to your perl code, where perl will automatically provide this data in the file handle DATA. The above question gives an example of how to use this using HTML::Template.

    For more info, check out perldoc SelfLoader for some more info on __DATA__.

    - Cees