in reply to == and != don't work as expected

Perl is a weakly typed language. Unlike C, for isntance, if you wanted to create a number then a string you could do:
my $string = 1; $string = "code"; # we can reuse the variable name
char* mystring = "this is a C style string"; int myInt = 1; // Can't reuse variable names // plus need to declare the type
You will find this paradigm called DWIM (Do What I Mean) by a lot of people. Basically, part of the price we pay for DWIM is that the interpreter doesn't choke and die on ambiguities, but makes a best guess.