Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Definition of numerically equal and rationale for 'you' == 'me'

by AnomalousMonk (Archbishop)
on Mar 01, 2012 at 23:07 UTC ( [id://957348]=note: print w/replies, xml ) Need Help??


in reply to Re: Definition of numerically equal and rationale for 'you' == 'me'
in thread Definition of numerically equal and rationale for 'you' == 'me'

Update: Now I look back, I see JavaFan made this exact point, so just see that reply.

2. Move right character by character, and throw away stuff that doesn't look like a number. If you never see a number, return 0.
3. When you find the first number, collect characters ...

I would quarrel with those assertions. Perl only looks for a number in the left-most part of the string. With warnings:

>perl -wMstrict -le "print 1 + 'x2x3x'; print 1 + '2x3'; " Argument "x2x3x" isn't numeric in addition (+) at -e line 1. 1 Argument "2x3" isn't numeric in addition (+) at -e line 1. 3
  • Comment on Re^2: Definition of numerically equal and rationale for 'you' == 'me'
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found