my $var = undef; print "Undefined!\n" if $var eq undef; $var = ''; print "Undefined again!\n" if $var eq undef;