sub isUndefOrWhitespace { my $str = ''; $str = shift; print "$str\n"; if (!defined $str) { return 0; }elsif (/^\s*$/) { return 0; } return 1; }