Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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 ...

In reply to Re: newbie and perl/web development by Cody Pendant
in thread newbie and perl/web development by neutron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found