I'm working on a CGI program that is currently of a decent length (almost 700 lines). Until recently, I did not have "use strict," (I'm a novice) so I decided to implement it and run through my code, making sure all variables had "my" and proper scope.

After eliminating all errors (by the way, I do use the -w option), my code *says* it runs fine, but at least one hash doesn't get values from the form(s) I use. I've found that when I initialize my %INPUT for my form, all values are null, even though they previously worked fine before the use strict implementation. In my block that gets STDIN and puts into $buffer, I try to print each key and value as it's put into the hash, but my program won't print them. In fact, it won't print ANYTHING, even hard-coded text.

Also, I've tried removing the "my %INPUT;" line and "undoing" some of the strict coding to (hopefully) allow it to temporarily work so I can figure out what went wrong and where. Unfortunately, this doesn't bring back my %INPUT, and I'm pretty much dead in the water.

No compiler errors/warnings, no way to tell why it's not working. I've searched elsewhere, but found no answer. Does anyone have any insight as to why my hashes aren't working?

Thanks,
Adam

In reply to use strict seems to hose my code by aeshirey

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.