Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Converting to number doesn't always work...

by parv (Parson)
on Nov 22, 2019 at 05:25 UTC ( [id://11109044]=note: print w/replies, xml ) Need Help??


in reply to Converting to number doesn't always work...

Ignore my earlier useless reply please, for I had missed your effort to extract a number inside the obtuse print statement.

Per perlop ...

For example $x + $y is always a numeric addition, and if $x or $y do not contain numbers, an attempt is made to convert them to numbers first.

... int( 'a2' ), e.g., is converted to '0' because of leading non-number. You could parse the string yourself to extract a number.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found