Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

HTML::Template and frames

by awkmonk (Monk)
on Apr 08, 2003 at 09:51 UTC ( #248869=perlquestion: print w/replies, xml ) Need Help??
awkmonk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

This is more of a 'how do the rest of you do it?' type of question.

My current CGI script has a fair amount of hard coded HTML, which I wish to separate out and use HTML::Template.

I have multiple processes running, updating 'status' files. I control the starting/stopping of these via a CGI web page. I have to display the current status of these processes (up to 200) refreshing about every 10 seconds.

The problem is that I'm also using frames. Will I need to set up several templates for the frames and their respective contents, or is there a better way to present the dynamic content (LAYER's perhaps? or HTML::Application?).

perldoc Template didn't give much of a clue, and I couldn't find much in Super Search or on Google (apart from references to JavaScript and DHTML).

Thanks for putting up with me.

'I think the problem lies in the fact that your data doesn't fit my program'.

Replies are listed 'Best First'.
Re: HTML::Template and frames
by benn (Vicar) on Apr 08, 2003 at 13:04 UTC
    You'll often need multiple templates anyway, irrespective of whether you use frames or not - its generally a lot cleaner to have a bunch of small templates that you put together (header, footer etc) than use a big HTML::Template with lots of 'if's etc. - nicer on your HTML people too :)

    Generally in this situation, where there are multiple frames updating at different times, I prefer to use a single script/Template combination for each frame - main.cgi, menu.cgi, info-frame.cgi etc.
    One thing you might consider is <iframe>, which is pretty well supported now and can clean up your layout considerably - much nicer than using DHTML (which should never be implemented using *shudder* 'LAYER' btw - but that's a whole other can-o-worms...).


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://248869]
Approved by Thelonius
[marioroy]: LA only $ and \ needed backslash, not ' and ".
[marioroy]: my @music_times = qx(find \$HOME/Music/ Albums -type f -iname '*.mp3' -exec mp3info -p "%S\\n" {} \\;);

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-04-23 22:33 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (433 votes). Check out past polls.