> As written, this script won't work. If you call the
> 'header()' function directly, you need to
> import this function from CGI. One way to do it is:
>
> use CGI qw/:standard/;
It works in the script I copy and pasted from ... :)
> Also, since you are already using CGI.pm, why not take
> advantage of its full functionality?
Because I hate the way it lay's out the HTML! All HTML elements are in
Capital letters (not xhtml compliant) and the source is layed out in a
manner that makes it difficult to read. Is there a switch to make CGI.pm
layout the code in lower-case?
> #!/usr/local/bin/perl -wT
> use CGI qw/:standard/;
> use strict;
>
> print header();
> my $javascript =<<END;
> <SCRIPT LANGUAGE="JavaScript">
> alert('test');
> </SCRIPT>
> END
> print start_html( -title => 'test script',
> -script => $javascript );
>
> Note that this reads very much like the actual Web page would
> and is fairly easy to follow.
Your code above introduces extra "<SCRIPT LANGUAGE="JavaScript">" and
"</SCRIPT>" elements to the page causing a javascript error. It is easier to
follow, however.
> Getting used to the built in HTML functions of CGI.pm can
> make the resulting HTML code much cleaner.
>
> Cheers,
> Curtis Poe
>
> =====
> Senior Programmer
> Onsite! Technology (http://www.onsitetech.com/)
> "Ovid" on http://www.perlmonks.org/
I appreciate your insight into CGI.pm, but I think I'll just keep doing
things the way I have (for now).
cheers,
Glenn
Glenn Tillema [EMAIL PROTECTED]
ADC Telecommunications, Inc.
PO Box 1101, MS 508
Minneapolis, MN 55440-1101
Learn about ADC - The Broadband Company - www.adc.com