my $var_val; if(defined($var_val)){ print "defined"; } else{ print "undefined": } #### my $var_val = 'something';