in reply to Handling undefined string content

If you're going to go the regex approach, I might test for the presence of a non-whitespace character instead of looking to see that the string is composed entirely of whitespace. Generally this will be faster:
if ($string !~ /\S/) { # $string is empty or composed entirely of spaces }
You might use length and/or the "trueness" of the string if you want to test if it has content at all.