Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

(jcwren) Re: CGI.PM related questions.

by jcwren (Prior)
on Jun 13, 2000 at 03:08 UTC ( [id://17808]=note: print w/replies, xml ) Need Help??


in reply to CGI.PM related questions.

Somthing like this:
use strict; use CGI; { my $p = new CGI; print $p->header; print $p->start_html ("Title Page"); print $p->p (center ($p->font ({-size=>'+7'}, "This is a test" +))); print $p->end_html; }
would give you this:
Content-Type: text/html <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML> <HEAD> <TITLE>Title Page</TITLE> </HEAD> <BODY> <P><CENTER><FONT SIZE="+7">This is a test</FONT></CENTER></P> </BODY> </HTML>
(I reformatted the HTML to make it more readable. CGI.pm usually runs stuff together)

It takes a little reading, but 'perldoc CGI' has some pretty good information. There's an excellent tutorial written by Lincoln Stein, that someone has a link to, but I don't know where it is. Anyone?

--Chris

Replies are listed 'Best First'.
RE: Re: CGI.PM related questions.
by merlyn (Sage) on Jun 13, 2000 at 04:02 UTC
    jcwren said something like:
    I reformatted the HTML to make it more readable.
    Have you seen CGI::Pretty? Just say use CGI::Pretty blah blah in place of use CGI blah blah. You get newlines and indented output. Cool.

    -- Randal L. Schwartz, Perl hacker

      Per the amazing Randal L. Schwartz, change the lineuse CGI;touse CGI::Pretty qw (:all);and you'll get pretty printing.

      CGI::Pretty is located here, via the CPAN search.

      --Chris
RE: Re: CGI.PM related questions.
by chromatic (Archbishop) on Jun 13, 2000 at 03:25 UTC
RE: Re: CGI.PM related questions.
by Anonymous Monk on Jun 14, 2000 at 11:48 UTC
    The recommended test CGI script generates the following error: Status: 302 Found Location: http://cgi2.tripod.com/bin/error?error=Your%20script%20produced%20this%20error%3A%20Unable%20to%20create%20sub%20named%20%22%2AMember%3A%3Acenter%22%20at%20.%2Fhello.pl%20line%2022.%0A URI: http://cgi2.tripod.com/bin/error?error=Your%20script%20produced%20this%20error%3A%20Unable%20to%20create%20sub%20named%20%22%2AMember%3A%3Acenter%22%20at%20.%2Fhello.pl%20line%2022.%0A Content-type: text/html Can anyone tell me what the problem is?
RE: Re: CGI.PM related questions.
by Anonymous Monk on Jun 14, 2000 at 15:36 UTC
    The recommended test CGI script generates the following error: Status: 302 Found Location: http://cgi2.tripod.com/bin/error?error=Your%20script%20produced%20this%20error%3A%20Unable%20to%20create%20sub%20named%20%22%2AMember%3A%3Acenter%22%20at%20.%2Fhello.pl%20line%2022.%0A URI: http://cgi2.tripod.com/bin/error?error=Your%20script%20produced%20this%20error%3A%20Unable%20to%20create%20sub%20named%20%22%2AMember%3A%3Acenter%22%20at%20.%2Fhello.pl%20line%2022.%0A Content-type: text/html Can anyone tell me what the problem is?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://17808]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found