There is no question about if one should use CGI or not. You should. The real question is if you
will.
Just one look through the site you reference is enough to make me run in fear. Here's a snippet of code in what is supposed to be an educational example:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
# parse the form data.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# where is the mail program?
$mailprog = '/usr/sbin/sendmail';
# change this to your own email address
$recipient = 'nullbox@cgi101.com';
# this opens an output stream and pipes it directly to the
# sendmail program. If sendmail can't be found, abort nicely
# by calling the dienice subroutine (see below)
open (MAIL, "|$mailprog -t") or dienice("Can't access
$mailprog!\n");
# ... (Continues)
No
warnings? No
strict? This is not educational, this is a bad B-movie!
In short, if you were to use CGI, you would save yourself a lot of heartache becase the CGI routines it implements work, and work well. In fact, after a little effort to figure out how to use them, it's so easy.
Don't get scared about CGI.pm, just invest in a good book, like the Lincoln Stein one, and spend a few hours reading about it. It will save you from a world of hurt!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.