Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Leading Zeros confound eval() ?

by misterperl (Pilgrim)
on Jul 21, 2015 at 19:08 UTC ( [id://1135704]=note: print w/replies, xml ) Need Help??


in reply to Re: Leading Zeros confound eval() ?
in thread Leading Zeros confound eval() ?

thank-you that explanation makes sense. Its a odd side-effect of eval, IMHO, but I see why it's working that way..

Voted you a ++

Replies are listed 'Best First'.
Re^3: Leading Zeros confound eval() ?
by Anonymous Monk on Jul 21, 2015 at 19:12 UTC

    BTW, official Perl documentation on this is here. Another difference is that underscores are not handled when strings are converted to numbers:

    $ perl -wMstrict -le 'print 0+ 1_234 ' 1234 $ perl -wMstrict -le 'print 0+"1_234"' Argument "1_234" isn't numeric in addition (+) at -e line 1. 1
      wow, I'm surprised by THAT also. Thanks again, very interesting results.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found