Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I see your question has already been answered thoroughly by the other fine monks, but I thought I might point out something that wasn't in your question. I notice you're doing a fair amount of directly printing HTML. You've probably heard this a thousand times, but this kind of thing should really be avoided. HTML::Template is my templating tool of choice, and I suggest you check it out. If you don't want the inconvenience of keeping a separate template file (though some may argue embedding the template directly in the Perl code is even less convenient), you can very easily put the text of the template in __DATA__ at the end of the script.

Here's a quick (and very untested) snippet showing how one might do such a thing:

#!/usr/bin/perl use strict; use warnings; use HTML::Template; my $var1 = 'foo'; my $var2 = 'bar'; my $template = HTML::Template->new(filehandle => *DATA); $template->param(var1 => $var1); $template->param(var2 => $var2); print "Content-Type: text/html\n\n", $template->output; __DATA__ <html> <head> <title>Test HTML::Template!</title> </head> <body> <p>Var1 is set to <!-- TMPL_VAR NAME="var1" --><br/> Var2 is set to <!-- TMPL_VAR NAME="var2" --></p> </body> </html>

In reply to Re: checking for valid http links by revdiablo
in thread checking for valid http links by swkronenfeld

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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-11-30 06:27 GMT
Find Nodes?
    Voting Booth?