in reply to Handling undefined string content

if ($var =~ /^\s+$/) { #do something. }
Explanation: the =~ makes a regular expression bind against a var, instead of $_ / / delimit the regexp. ^ denotes the beginning of a string, $ the end. \s+ means one or more whitespace characters, which is space, \n, \t, \v, or \r. So the whole thing means: do something if, in this var, there's nothing but whitespance between the beginning and end of the contents.

Check out perlre. Regular expressions are good.

Enjoy

Trinary