There's more than one way to do things | |
PerlMonks |
Re: templates vs here docsby mwah (Hermit) |
on Dec 19, 2007 at 22:25 UTC ( [id://657990]=note: print w/replies, xml ) | Need Help?? |
... using a here doc and xslt transforms for outputting html ... In the last months or so I wrote a bunch of Perl scripts for compute cluster control - which do lots of wicked rsh's into a cluster an present nice html output to the coworkers. I started out w/heredocs, then changed that to qq{..}-strings, then throwed the towel and used (sound on) a nice little module called: This was a stunning experience, after (short) working through the details, I ended up with a HTML-File per script (same name as the script + .htm) and several very clean and easy readable Perl scripts. The proloque to the action would be identical across the scripts, in my case that's sth. like:
the corresponding html would be edited in Dreamweaver (or whatever you like) and look like:
The variables set in the perl program would show up in the html as
and the perl program would set the variables like:
where he last line would send the html to the browser. So that's what I'd recommend. HTML::Template is ideal suited for this kind of CGI-script things. Regards mwa
In Section
Seekers of Perl Wisdom
|
|