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
As already mentioned by several people, eq is the right operator here.
eq
If you use warnings; in your script, you'll get warnings about this (and many other useful things); I'd recommend use strict; as well.
use warnings;
use strict;