Hi there. I am attempting to test a script that worked without error on my windows box to a Red Hat Linux distro. I get the error 'Use of uninitialized value in pattern match (m//)' on the first line of the if statement from the function below. I've found examples of this error online but fail to see how they apply to my situation. How can I fix this error? Thanks.
sub isUndefOrWhitespace { my $str = ''; $str = shift; print "$str\n"; if (!defined $str) { return 0; }elsif (/^\s*$/) { return 0; } return 1; }
In reply to Use of uninitialized value in pattern match (m//) by troyhughes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |