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

Re: Detecting if a scalar has a number or string

by Thelonious (Scribe)
on Nov 18, 2004 at 00:54 UTC ( [id://408667]=note: print w/replies, xml ) Need Help??


in reply to Detecting if a scalar has a number or string

About the 0+ issue, 0+ is only used in a boolean test, like while or ?:. In your code, you're actually using the + operator. You're just using it to add 0 to your var. It's funny about Scalar::Util. I get the same thing. I can't wait to hear a reason... You might try DBI::looks_like_number(), which does something I don't know what, but it looks cool! (I'm pretty sure that it checks for whether a var is currently being considered a number or a string. Best,
  • Comment on Re: Detecting if a scalar has a number or string

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-26 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found