Howdy Monks,

I'm new to CGI scripting, and so I'm wondering if there's an elegant way to include all those other languages in my output. Right now I have stuff that looks like this:

print "<table cellspacing = 8 border = 1>"; my $count = 1; print "<tr><td>None of these--what I entered was correct:<p>Company: $ +original_address->{'company'}<br>Name: $original_address->{'addressee +'}<br>Street: $original_address->{'street'}<br>Street2: $original_add +ress->{'street2'}<br>Suite: $original_address->{'unitNumber'}<br>City +: $original_address->{'city'}<br>State: $original_address->{'state'}< +br>Zipcode: $original_address->{'zipCode'}<br></td><td><input type=\" +radio\" name=\"addresslist\" value=\" $count \"></td><td><p class=\ +"form_submit_action\"><input id=\"order\" value=\"Submit\" type=\"sub +mit\" /></td></tr>"; etc.
...and this is just for my proof of concept version. When my company's web designers get involved there's going to be all kinds of javascript/css in place of the above, and I just can't help thinking that this is ugly, hard to read code. However, it doesn't appear that CGI.pm has all the functionality they're going to want for outputting their pretty js/css code. Any best practices to guide me would be very much appreciated!

In reply to CGI and writing html/javascript/css elegantly by rastoboy

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.