in reply to Handling undefined string content

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