my $var=undef; if(defined($var) && $var==1) { # tu was ... } elsif(!defined($var)) { # variable nicht definiiert } else { # variable != 1 }