defined(expr); # where expr is typically a variable such as $list[7]
|
returns true if expr is defined (i.e. not equal to undef)
|
undef $scalar; undef @list; undef %hash; # set all elements in passed reference to be undefined -- the argument can also be things like $hash{key};
-
undef on its own represents undefined value for returning from subroutines etc.
|
undef can be very useful -- for instance you may wish to reuse a hash %parms and execuate undef %parms before re-use.
|
exists($hash{place}); returns true if place has been defined as a key to %hash-- note this tests existence of associative memory key -- the value $hash{place} may still be undefined!
|