Pete Emerson wrote:

> The CGI module is fantastic for doing things like printing headers,
> parsing forms, etc. I don't think I've written a CGI script without it.
> Your missing the header. See 'perldoc CGI'.
> 
> #!/usr/bin/perl -w
> 
> use strict; # Highly recommended!
> use CGI qw(:standard);
> 
> print header;
> print start_html;
> print "Hello world!<BR>\n";
> print end_html;


#!/usr/bin/perl
use warnings;
use strict;
use CGI qw(:standard :html3 -no_xhtml);
# use CGI::Pretty qw(:html3); # use this for multiline html output
                              # leave out for faster downloads of pages
print header(), 
    start_html(),
    h2({-align=>'center'}, 'A Simple Test'), hr(), br(),
    p({-align=>'center'}, "Hello World!"),
    end_html();

# in this manner (the function-oriented interface of CGI.pm) you can
# code up perl as if it were HTML, and it even LOOKS like it. 
# AND properly opens/closes html tags in the right places for you. 

# :-)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to