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


in reply to passing data to variable in if statment

Use defined $var to see if a variable is defined or not. "" is different from undef