Perl 101: The email form (
Page 1 of 5 )
Never worked with Perl but always wondered how it works? In this article Pete starts from scratch, explaining everything we need to know to code, test and implement a "mail me" script with Perl. He shows us how to setup the form, how to use the CGI module, and also how to pipe commands directly to sendmail. If you've never worked with Perl before, then this article is exactly what you need to get you started!So, you've spent hours creating killer graphics in PaintShop, drafted and
redrafted your 'about me' section, and scanned in photos of your family and
pets. Your next step towards creating your dream website is to add interactivity
- and one of the best ways to do that is with Perl CGI. In this article I'll
take you through everything you need to know to get started with Perl, finishing
with the code for a 'mail me' form to allow your visitors to easily get in
touch. But first things first...
You'll need a webhost which offers CGI
scripting - and sadly most of the free ones don't. Of those which do,
Hypermart is one of my
favourites. Alternatively, if you're willing to pay a few dollars per month,
there are plenty of hosting companies out their who provide full CGI scripting
along with lots of other goodies for budding web designers.
If you don't
know any Perl, then that's fine, although having some experience with another
scripting language such as PHP will help you understand certain things a bit
more clearly, such as regular expressions. Anyhow, now that we've gotten all of
that out of the way, let's move on to learn some Perl...