Use Perl to generate your skeleton? Nonesense. All i do is
create a "skeleton" that describes the layout. I usually
start by lifting a layout from
Box
Lessons. Then i either use
HTML::Template or
Template. Here is a quick skeleton that i used
recently with Template-Toolkit:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/
+/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="/css/default.css" type="text/css" />
<title>[% title %]</title>
</head>
<body>
<div id="top">
<h1>[% title %]</h1>
</div>
<div id="left">
[% PROCESS widget/menu.html %]
</div>
<div id="middle">
[% content -%]
</div>
<div id="right">
[% PROCESS widget/calendar.html %]
</div>
<div id="bottom">
[% PROCESS widget/footer.html %]
</div>
</body>
</html>
As you can see, the CSS file is completely seperate and not
generated by Perl! Instead, Perl is used
to load this template and substitute, etc. This is, IMHO,
a much better solution as it allows me to hand my HTML to
someone who designs and doesn't code.
So, in conclusion, my experience has been that the more
flexible and useful applications of Perl and CSS are to
simply template the skeleton and let Perl worry about the
data, not the presentation. Otherwise you might as well be
using Tk.