--- "Tillema, Glenn" <[EMAIL PROTECTED]> wrote:
> > 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 ... :)

This is very confusing to me because this:

    perl -MCGI -e "print header();"

Results in this:

    Undefined subroutine &main::header called at -e line 1.

The CGI module is not supposed to export any functions without their being explicitly 
requested. 
Maybe you have a version that someone else hacked?  No matter.

> > 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?

If it's printing out your tags in lower case, you definitely have an issue with 
CGI.pm.  Check
your version number (print $CGI::VERSION).  2.753 is the latest version and generates 
valid XHTML:

C:\>perl -e "use CGI::Pretty qw/:standard/;print 
start_html,h1(qw/Heading/),p(qw/test/),end_html"

<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en-US"><head><title>Untitled 
Document</title>
</head><body>
<h1>
        Heading
</h1>
<p>
        test
</p>
</body></html>

If you like CGI::Pretty, be sure to upgrade to the latest version (1.05), as earlier 
versions tend
to be buggy.

> I appreciate your insight into CGI.pm, but I think I'll just keep doing
> things the way I have (for now).

So long as it works, that's fine by me :)

Cheers,
Curtis Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to