I absolutely agree with you that most CGI projects aught to use CGI.pm, however this is not a cgi script. Proper HTML formatting is only one of the benefits of CGI, but it also comes at a cost: you have to know what you are writing early. Example, the same table as before, but with CGI:
my @table; while( @linkURL ) { my $linkLeft = td( a( { -href => pop( @linkURL ) } pop( @linkName +) ) ); my $linkRight = @linkURL ? td( a( { -href => pop( @linkURL ) } pop +( @linkName ) ) ) : " "; push @table, TR( $linkLeft, $linkRight ); } print FILE table( {}, @table ) or die "Print Failed, $!, $^E\n\t ";
Yeah, that's more Perl-ish, but its also less straightforward. Why should I have to build up the entire table in memory before I can print it to the file?

So I didn't use CGI. I did think about using CGI, I do know how to use CGI, and I made the decision that I didn't want or need CGI for this 10 minute project. Now, if I were runing a web server on my desktop and wanted this page generated on the fly (which would be cool) I would use CGI to generate the header() info for me. I would also use the start_html() and end_html() functions, but I still wouldn't use the table functions.

Thank you, by the way, for bringing up the subject. Too many people forget that CGI is just another tool in the tool box. Sometimes it isn't the right solution, sometimes its not the right tool.

PS: Thanks for the tip on <center> being deprecated. I did not know that. According to the w3c spec for HTML 4.01 I should have used <DIV align=center>.


In reply to Re: Re: MSIE Favorite Start Page by Adam
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.