One could try to call them tradeoffs rather than mistakes, but then you'd have to explain why the programmer benefits from such circuitous thinking.
The mistake, if any, is that numbers and strings are unified into one scalar type in Perl. This allows some tricks, such as being able to use sprintf to perform rounding, but it has fallout in other places in the language, such as here. Given that numbers and strings are unified, having two operators for comparison is the correct decision: it makes the semantics much simpler by having the language not guess which kind of comparison to perform.
For bash, read http://unix.stackexchange.com/questions/16109/bash-double-eq... (especially http://unix.stackexchange.com/a/120235) and weep.
For perl, see for example http://www.perlmonks.org/?node_id=276023
This is why disciplined (i.e. non-tiny-script-y) perl code starts off with
use strict;
use warnings;
just like disciplined javascript starts off with /* use strict */
and disciplined C code enables compiler warnings, and truly disciplined C code makes those fatal, just like in perl you can do use warnings FATAL => 'all';
If you don't do that, then you get the short script/one liner style behaviour where, just like sed, awk or bash, it assumes you know what you're doing. If you don't, then you should be asking the VM to help tell you when those problems exist, same as 'set -x' in bash is incredibly useful if you don't plan to add '|| exit 255;' onto the end of every command.How do you evaluate this, depends on the context. Wasn't that the whole point of a dynamic language anyway?
Javascript, PHP and Perl are weakly typed. Smalltalk, Lisp, Python, Ruby... are strong typed. But all of them are dynamic.
[1] http://en.wikipedia.org/wiki/Strong_and_weak_typing#Predicta...
I don't particularly care how many forms of equality or comparison a language has as long as the compiler or runtime is capable of telling me the particular one I'm using is probably wrong. If == can't be used with strings the damn interpreter should tell me so instead of silently and improperly coercing the arguments.
$ perl -e 'use warnings; use strict; print "content" == "foo", "\n"'
Argument "foo" isn't numeric in numeric eq (==) at -e line 1.
Argument "content" isn't numeric in numeric eq (==) at -e line 1.
1Btw, Java will silently compare references instead of value. Learning a language != increasing vocabulary.