Front page | perl.beginners |
Postings from March 2008
perl warnings
Thread Next
From:
Kashif Salman
Date:
March 17, 2008 11:08
Subject:
perl warnings
Hello,
I have a CGI script; when it runs the very first time I define some variables
my $action = $q->param('action');
The first time it runs, parameter 'action' isn't defined so that is
how I check that it is running the first time and do my things
if ($aciton eq "") {...}
elsif ($action eq "submit") {...}
the elsif runs if I hit a button on a form which has a hidden field
that sets action="submit". My question is that the script produces a
warning on the if statement " Use of uninitialized value in string eq
". How can I get rid of that without using "no warnings". I tried 'if
(defined("$action"))' but that still produces a warning.
Regards,
Kash
Thread Next
-
perl warnings
by Kashif Salman