Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found