Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: irritation makes perls

by Herkum (Parson)
on Sep 25, 2009 at 14:21 UTC ( #797518=note: print w/replies, xml ) Need Help??

in reply to irritation makes perls

Such as the fact that there are two sets of comparison operators

Would you rather do what all the other languages do, declare every variable as specific type( a string, a number, a null, or an object). I can live with two operators.

Using == with strings accounts for at least 90% of my mistakes

You must be use to another language, like Javascript. This is not a problem with Perl, but rather what you have become used to.

Replies are listed 'Best First'.
Re^2: irritation makes perls
by Anonymous Monk on Sep 25, 2009 at 21:17 UTC
    Turns out you shouldn't use == in javascript, JS doesn't have warnings/strict (although it will have strict in the future)
    '' == '0' // false 0 == '' // true 0 == '0' // true false == 'false' // false false == '0' // true false == undefined // false false == null // false null == undefined // true " \t\r\n " == 0 // true

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://797518]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2021-09-24 13:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found