Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

newbie and perl/web development

by neutron (Sexton)
on Jan 19, 2009 at 00:07 UTC ( [id://737191]=perlquestion: print w/replies, xml ) Need Help??

neutron has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone,

I've been steadily working my way through "Learning Perl" by Schwartz. I've also browsed through the table of contents of "Intermediate Perl", neither of which make any mention of integrating Perl programs into html webpages.

Does anyone have any good resources on this?

Thanks, neutron

Replies are listed 'Best First'.
Re: newbie and perl/web development
by Cody Pendant (Prior) on Jan 19, 2009 at 00:30 UTC
    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:

    1. First, understand HTML
    2. Write a perl script which outputs HTML
    3. Put print "Content-type: text/html\n\n"; before any other output.
    4. Put it on a web server
    5. chmod it so it's executable
    6. 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 ...
Re: newbie and perl/web development
by GrandFather (Saint) on Jan 19, 2009 at 01:02 UTC
Re: newbie and perl/web development
by planetscape (Chancellor) on Jan 19, 2009 at 04:28 UTC
Re: newbie and perl/web development
by merlyn (Sage) on Jan 19, 2009 at 02:03 UTC
Re: newbie and perl/web development
by ww (Archbishop) on Jan 19, 2009 at 02:03 UTC

    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).

Re: newbie and perl/web development
by nagalenoj (Friar) on Jan 19, 2009 at 03:04 UTC
    If you are using linux, you can also look the man page for cgi.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://737191]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-03-29 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found