Vous êtes sur la page 1sur 1

The defined Function

To tell whether a value is undef and not the empty string, use the
defined function, which returns false for undef, and true for everything else:
$madonna = <STDIN>;
if ( defined($madonna) ) {
print "The input was $madonna";
} else {
print "No input available!\n";
}

Vous aimerez peut-être aussi