http://www.perlmonks.org?node_id=1023368


in reply to Check For null Arguments

A better way to check for particular value is defined or not, use defined function in perl.

Syntax: defined EXPR

defined function will return true if EXPR has a value other than the undefined value "undef".
Defined function will return true even if the value of particular scalar is null string. To check whether value of scalar is defined and not null, use following code.

my $defined_string="Defined_value"; print "Value of defined_string is defined and its value:$defined_strin +g" if(defined $defined_string && $defined_string ne '');