Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: How can I test for the representation of an integer?

by BrowserUk (Patriarch)
on Apr 25, 2016 at 13:31 UTC ( [id://1161449]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I test for the representation of an integer?
in thread How can I test for the representation of an integer?

Trouble with that is it treats both 1, and '1' (and 1.0 and '1.0') as looking like numbers (albeit with strangely different values of true)

use Scalar::Util qw(looks_like_number);; [0] Perl> print looks_like_number( $_ ) for 1, '1', 1.0, '1.0', '1o';; 4352 1 8704 5 0

But the OP wants to distinguish between 1 stored internally as an integer; and '1' stored internally as a string.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-20 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found