in reply to cgi question

Another way to do this might be this:

#!/usr/bin/perl -w use strict; use CGI; print "Content-Type: text/html\n\n"; print "<p>resource input</p>\n"; print "<h1>resource</h1>\n";
Second way might be:
print << "END_OF_HTML"; Content-Type: text/html\n\n <p>resource input</p> <h1>resource</h1> END_OF_HTML

Might take a look at Ovid's Course

Thanks to jeffa for pointing this node out: (Ovid - CSS in external file) Re: CGI

Update: Changed first line as it wasn't worded right and added last line

"Pain is weakness leaving the body, I find myself in pain everyday" -me

Replies are listed 'Best First'.
(jeffa) 2Re: cgi question
by jeffa (Bishop) on Jun 18, 2003 at 15:33 UTC
    Just because the original poster forgot a semi-colon does not mean that we should persuade them from using CGI.pm's HTML generation methods, IMHO. All preferences aside, at least promote header:
    use strict; use warnings; use CGI qw(header param); print header(); print "<p>resource input</p>\n"; print "<h1>resource</h1>\n";
    But for something this small, why type all of that when what the OP had (with that semi-colon in the right place) works just fine?

    Kudos, howver, for promoting Ovid's stuff. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)