Re:Why Perl Didn't Win
by aphexairlines on Monday June 09, 2014 @03:51AM
(#7867407)
The interpreter does tell you.
$ 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.
1
Re:Why Perl Didn't Win
by amenbrother on Monday June 09, 2014 @04:25AM
(#7867473)
Thanks - I'll try to remember that if I ever have to touch perl again.
Re:Why Perl Didn't Win
by cubancigar11 on Monday June 09, 2014 @02:06AM
(#7867257)
You should have used strict and warnings. RTFM, I know.
Btw, Java will silently compare references instead of value. Learning a language != increasing vocabulary.
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.