Use a regular expression:
if ($var =~ /^\s*$/) { # do something }
The regex means "if $var consists of nothing but 0 or more spaces between the beginning and the end ..." (for more on that, type perldoc perlre on your system)
Beware : defined has a meaning in Perl.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: Handling undefined string content
by arturo
in thread Handling undefined string content
by akm2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |