Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by parv (Vicar)
on Nov 22, 2019 at 05:25 UTC ( #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
Node Status?
node history
Node Type: note [id://11109044]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-10-29 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (269 votes). Check out past polls.

    Notices?