Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: why are hex strings not numbers?

by Anonymous Monk
on Sep 26, 2016 at 22:14 UTC ( #1172682=note: print w/replies, xml ) Need Help??


in reply to Re^2: why are hex strings not numbers?
in thread why are hex values not numbers?

Then why does the string "65" print out "ok"? I didn't eval or convert it first.

Because 65 looks like a number but 0x65 does not. See perlnumber, http://perldoc.perl.org/perlapi.html#grok_number_flags (the meat of http://perldoc.perl.org/perlapi.html#looks_like_number, maybe even on truthiness

You can always change this with overload::constant, Numification of strings

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-12-07 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?