CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
uninitialized help!!!

 



nezumi
Deleted

Mar 14, 2001, 9:32 AM

Post #1 of 2 (336 views)
uninitialized help!!! Can't Post

Hello I have a script that begins with:
#!/usr/bin/perl -w
use strict;

and I get the following warnings...
Use of uninitialized value at ./admin.pl line 43.
Use of uninitialized value at ./admin.pl line 51.
Use of uninitialized value at ./admin.pl line 112.


the respective lines are...
my @Pares = split(/;/, $ENV{'HTTP_COOKIE'});
if ($COOKIE{'LGuser'} eq "" && $FORM{'ProcLoginCheck'} eq "") { &LOGIN; exit; }
print qq|

What is happening here???

HELP!!!



Jean
User


Mar 15, 2001, 2:24 AM

Post #2 of 2 (329 views)
Re: uninitialized help!!! [In reply to] Can't Post

Some of your variables have not been initializaed.
For example, 'HTTP_COOKIE' does not exist in the
environment, or LGuser does not exist or is not
defined in the %COOKIE.

Usually it is not a major problem, because Perl
substitutes uninitialized value with 0 in numeric or "" in
string context, though sometimes this may point you to
the variable that was supposed to be initialized and wasn't.
In general, you may use defined($var) instead $var eq "" to avoid this situation.

defined() returns true in case some value has been assigned to the variable, even "" and false otherwise.

Jean Spector
QA Engineer @ Extent Technologies, Ltd.
mage@lycosmail.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives