[H-GEN] CGI Troubles.
Brent Wesley
brent at scanningsystems.com.au
Tue May 15 00:11:08 EDT 2001
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
Jason Henry Parker wrote:
> On Tue, May 15, 2001 at 12:27:08PM +1000, Brent Wesley wrote:
>
> > #!/usr/bin/perl -w
> >
> > use strict;
> > use CGI qw(:standard);
> >
> > my $page = new CGI();
> > print $page->header;
> >
> > $page->start_html('Hello World');
>
> That's a no-op.
>
> > print "Hello World!\n";
> >
> > $page->end_html;
>
> And so is this.
>
> The CGI object returned by new() knows nothing about the business end
> of the connection; to have it send HTML back to the client you have to
> do something more like this:
>
> #!/usr/bin/perl -w
>
> use strict;
> use CGI qw/:standard/;
>
> my $page = CGI->new; # Indirect object syntax sucks
>
> print $page->header,
> $page->start_html('Hello World'),
> 'Hello World!',
> $page->end_html;
>
> Your script ends up being broken because it says the content-type is
> text/html but the content sent back doesn't contain a single HTML tag.
>
Works fine for me. I have also check in The official guide to programming with
cgi.pm by Lincoln Stein and it also does it that way. :p
>
> > Have Fun.
>
> I am. Thanks.
>
Good I'm glad to hear it.
--
Brent Wesley
Systems Programmer
Scanning Systems (Aust.)
http://www.scanningsystems.com.au
PH: 07 3809 3333 FAX: 3809 3335 http://www.humbug.org.au
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list