cbussanich has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I would appreciate any help.
I am writing some basic CGI scripts. I am testing to see if any parameters were passed to my script via CGI. When I pass CGI variables, param is not behaving nicly. Line 97 is the first line here. My code segment is:
Use of uninitialized value in string eq at d:\ .... myScript.pl line 97, line 127 (#1) (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer to the concatenation (.) operator, even though there is no . in your program.
The following warning appears while stepping through the debugger, and at the bottom of the web page that my script generates.if ( ! param ) { # No parameters passed in. print "No parameters were passed to script."; }
Use of uninitialized value in string eq at d:\ .... myScript.pl line 97, line 127 (#1) (W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a "" or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer to the concatenation (.) operator, even though there is no . in your program.
Is this a warning I should worry about? I am using "strict" and -w, by the way. Many thanks, Colin
|
---|
Replies are listed 'Best First'. | |
---|---|
(elbie): What does this warning mean?
by elbie (Curate) on Aug 17, 2001 at 01:05 UTC | |
by davorg (Chancellor) on Aug 17, 2001 at 12:08 UTC | |
by elbie (Curate) on Aug 17, 2001 at 18:26 UTC | |
by davorg (Chancellor) on Aug 17, 2001 at 19:03 UTC |
Back to
Seekers of Perl Wisdom