Another joy of Perl:
if ("foo" == "bar") {
This prints xyzzy. Why?
in Perl == means numeric equality. And "foo" and "bar"
both evaluate to 0. If you want string
equality, you have to use eq.
Of course I know this but do I remember it always? No.
print "xyzzy\n"; } The principle of least surprise is important in scripting languages. Perl fails this principle. |