My copy of "Learning Perl" has stuff about CGI, in chapter 19. It's an old edition, but still.
Here's a really quick lesson on how to do web pages with Perl:
- First, understand HTML
- Write a perl script which outputs HTML
- Put print "Content-type: text/html\n\n"; before any other output.
- Put it on a web server
- chmod it so it's executable
- Go to its URL
I'm being a bit facetious, but clearly that point 1. there is something of a big issue.
What you should do, as soon as you've got the absolute basics, like the above, out of the way, is to learn a templating module. I'd recommend HTML::Template, which has never let me down. I've wondered if I might outgrow it and need to use another module, but every time I've wanted to do something, it's been there in the documentation. And of course you'll need to understand the basics of CGI.pm as well.
The normal progression of someone doing web pages with perl is "lots of crappy print statements; lots of crappy HEREDOCs; use of a templating module." -- do yourself a favour and skip/spend as little time as possible on, those first two.
Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...
| [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |
Lincoln Stein (who wrote CGI.pm) wrote the "Official Guide to Programming with CGI.pm" (Wiley, 1998, ISBN 0471247448).
It is ( Well, "was at publication") comprehensive and coherent. No, it doesn't address modern templating modules, but the value of those will be dependant on the scope and scale of your needs.
As of this writing, Amazon, Abe Books, Half.com and eBay list used copies from US$1.07 up. Some of those offer a new copy at $40.00. It's certainly worth more than the lowest listed price (and to me -- though the edition is a decade old -- has been and continues to be worth more than the $30. I paid).
But, pray heed Cody Pendant's first point: Understand HTML, first, or the lack thereof will rise up and -- at best -- aggravate you greatly. To that, I would add, second: get at least a basic familiarity with CSS, as using styles will simplify your HTML (and often, make it more concise).
| [reply] [Watch: Dir/Any] |
If you are using linux, you can also look the man page for cgi. | [reply] [Watch: Dir/Any] |