programming-examples/perl/SystemFunction/The defined Function.pl
2019-11-15 12:59:38 +01:00

9 lines
375 B
Perl

#If a scalar has neither a valid string nor a valid numeric value, it is undefined.
#The defined function checks for the validity of a variable's value.
#defined Function returns 1 if the variable has a value and null if it does not.
#defined Function also checks the validity of arrays, subroutines, and null strings.
$name="A";
print "OK \n" if defined $name;