On Mon, Mar 17, 2008 at 11:46 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > > Kashif Salman wrote: > > 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. > > if ( ! $action ) {...} > > --
if( defined $q->param('action') ) #still produces the warning if ( ! $action ) #worked thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/