First off, your code doesn't compile:

$ perl -Tcw /tmp/nuts.pl Missing right curly or square bracket at /tmp/nuts.pl line 25, at end +of line syntax error at /tmp/nuts.pl line 25, at EOF /tmp/nuts.pl had compilation errors.

Once you've sorted that, you'll need to take another hard look at your open statement and realise that the second argument is a URL, so the open will almost certainly fail.

Then there's the fact that you are opening (or trying to open) a file for reading and then immediately write to it. That isn't going to work either.

You also have a use CGI line in there, but it isn't clear to me why you have done that when you are not apparently using any of its features.

Final tip: don't just guess why your script doesn't work - check the error log on the server.


In reply to Re: Nothing is happening in my CGI code. by hippo
in thread Nothing is happening in my CGI code. by bgatto

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.