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,
|