We don't bite newbies here... much | |
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?? |
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.
In Section
Seekers of Perl Wisdom
|
|