I\'ve just been using this code to check if a string is empty:
if ($str == \"\") { // ... }
And also the same with the not equals operato
You probably want to use "eq" instead of "==". If you worry about some edge cases you may also want to check for undefined:
if (not defined $str) { # this variable is undefined }