Perl and CGI together eh? Well that is a hard match to pull off if you are new to programming

I would suggest looking through our tutorials. Many of the elder monks have written good stuff for doing things

However, looking at your code. Well unless my dyslexia is kicking in; you have your "N/A"s without quotes.

Start using "use strict" and "use warnings" they are your friends and will point out problems for you. Your NA issue would have been reported to you.

You made this harder then it needs to be. Why not simply read in the line, then have:

if ($comment1 eq " ") { $comment1 = "n/a"; } if ($comment2 eq " ") { $comment2 = "n/a"; }

Then you can have 1 print statement

Some friendly advice. Pick up either Learning Perl or Begining Perl. They should help you with some examples on doing things.

As I said Learning CGI and Learning Perl is hard to do at the same time. You probably should have gotten comfortable with Perl before doing the CGI class. Good luck and don't get discouraged. Perl is a fun language!


In reply to Re: Help ! New in perl and cgi by Marza
in thread Help ! New in perl and cgi by britney

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.