On Friday 08 June 2001 16:29, [EMAIL PROTECTED] wrote:
> I am getting:
>
> Use of uninitialized value in string eq at ./adpanel.pl line 37.
>
> even though my line 37 appears as:
>
>
> if ( $action eq "add" ) { <-- line 37
> $add_alias = $formdata{alias};
> $add_destination = $formdata{destination};
> $add_tag = 1;
>
> }
>
>
> earlier in the script, i have
>
> my $action;
> my $add_alias;
> my $add_destination;
> my $add_tag;
>
> do i need to define my $formdata?
You get this warning because $action is undefined. Comparing undefined value
with something is usually unwanted, so it produces a warning.
You could rewrite it to:
if (defined($action) && ($action eq 'add')) {
or assign something meaningful to $action before you use it.
--
Ondrej Par
Internet Securities
Software Engineer
e-mail: [EMAIL PROTECTED]
Phone: +420 2 222 543 45 ext. 112