Re: Perl and CSS
by Mike Schienle <mgs(at)ivsoftware.com>
|
Date: |
Wed, 24 May 2000 10:12:59 -0700 |
To: |
"Rob Eager" <rad_dev(at)ihug.com.au>, <hwg-languages(at)mail.hwg.org> |
References: |
rad |
|
todo: View
Thread,
Original
|
|
At 9:36 PM +1000 5/24/00, Rob Eager wrote:
>Here's the question.
>
>I know that perl has some support for css but I'm not sure what is
>needed to make it work. I've tried putting it in as a normal perl
>print statement wherever the script generates a html header but
>that's not working. Could someone please explain what mods are
>needed and if it is really worth it (after all it's only the one page
>that isn't using the css).
Here's the relevant source for a perl CGI that uses CSS's:
# include the CGI module
use CGI qw/:standard :html3 *table/;
# specify the header (pre-HTML) info
print header(
-expires=>'-1d',
-pragma=>'no-cache'
),
# specify the HTML HEAD tags
start_html(
-title=>'Causal Effects',
-author=>'"Mike Schienle" mgs(at)ivsoftware.com',
# specify the style sheet
-style=>{
-src=>'/styles/causal.css'
}
);
Here are a couple lines from the causal.css file:
BODY {background-color: #cccccc}
TH {background-color: #333333; color: #cccccc}
For much more info, check out "Official Guide to Programming with
CGI.pm", by Lincoln Stein (also the creator of CGI.pm source code).
<http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0471247448>
--
Mike Schienle Interactive Visuals, Inc.
mgs(at)ivsoftware.com Remote Sensing and Image Processing
http://www.ivsoftware.com/ Analysis and Application Development
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA