I'm ambivalent about making a reference to CGI.pm, since the script is so short and sweet. But I guess I will anyway. Handcoding HTML into scripts is a bad habit. And in this case, using CGI allows you to make program logic clearer. Plus, you can generate well-formed HTML with about half the typing, and a lot less worries about it breaking.

Update

Apparently I'm getting downvotes for a reasonable suggestion. Here is an example of how much cleaner the code looks when you use CGI to save a static HTML file:

use CGI qw(:standard); open (FILE, ">test.html") or die "cannot open test.html: $!\n"; print FILE ( start_html( -title => "test page" ), p( "Test paragraph." ), p( "Here is a second paragraph." ), hr(), p( "This is the last." ), end_html() ); close FILE;

PS. The <center> tag has been deprecated for three years.


In reply to Re: MSIE Favorite Start Page by ichimunki
in thread MSIE Favorite Start Page by Adam

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.