***@S04:~$ perl -we '$foo = "f"; print "Success\n" if ($foo ne "e")' Success ***@S04:~$ perl -we '$foo = "f"; print "Success\n" if ($foo eq "e")' ***@S04:~$
Have you tried to check what $category is actually? Sometimes these things can slip even the best of us ... Perhaps these are lowercase letters or something completely different.
When I get unexpected errors, I usually use separator printing around what I want to print, so I know where it starts and ends (as opposed to what my mind could interpret).
print "|>${category}<|";
Something else note, Data :: Dumper :
use Data::Dumper; print Dumper(\$category);
source share