in reply to problem with variable
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: problem with variable
by cal (Beadle) on Jul 18, 2002 at 02:07 UTC | |
| [reply] [d/l] |
by jarich (Curate) on Jul 18, 2002 at 08:17 UTC | |
I don't know why not, but ReadParse is not working as you want it to in this instance. As a result $input{month} is undefined and so $month is too. Since you're using CGI, and you know how to pull parameters out, I'd suggest you replace this block of code with something more like: This will fix the problem you've described (and make you aware of a lot more).
Read more... (7 kB)
Hope this helps. jarich | [reply] [d/l] [select] |
by blahblahblah (Priest) on Jul 18, 2002 at 03:36 UTC | |
Add them starting with the first time you reference $month, and then keep adding them until you get to one that doesn't have the value. Or, start in the middle somewhere and do a binary search.
-Make sure to number them or make them unique in some other way so that you can see correlate the output to the code.
Just adding these print statements and identifying where the value is lost should make it clear to you what's going wrong. If it doesn't, then post the new code and note exactly where the value disappears and it might be clear to someone else here. It seems like such an ugly and stupid way of debugging but simple print statements are often the quickest way to find bugs of this sort. | [reply] [d/l] |
by Abstraction (Friar) on Jul 18, 2002 at 03:20 UTC | |
| [reply] [d/l] |
by fuzzyping (Chaplain) on Jul 18, 2002 at 04:26 UTC | |
Rather, I suggest you make sure to utilize the CGI::Carp module when developing any perl CGI. However, I also suggest that you only use fatalsToBrowser (in its default form) during development and testing... if you must leave it in there, please consider customizing the errors. Leaving the vanilla responses in there can provide more information to guests than you want to let loose. When this routine is imported via use, fatal errors, such as those produced by die and confess, send error messages to the browser as well as the error log. A simple HTTP response is created with the error message, followed by a request to send mail to the web administrator.** -fp ** Perl In a Nutshell, Chapter 8, O'Reilly Publishers Update: Note about fatalsToBrowser customization. | [reply] [d/l] |