Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

But you've turned off the warning telling you that it doesn't looks_like_number. If you don't have warnings on, Perl assumes you know what you're doing and tries to do what you've asked it to with the (crummy) numberish data you've given it. If you have enabled warnings, it lets you know about it's misgivings but still goes ahead and does what you've asked.

I think the expectation mismatch is because Perl uses the (POSIX) C strtod(3) which by design (or at least by the manual page description :) follows this heuristic (from the start of the char* passed parse off as many digits followed by an optional "." and more digits followed by an optional exponent notation, and stop when you hit a not-digit-not-plusminus-not-exponent-marker character) rather than using if-looks_like_number-number-else-it's-zero. This is mentioned in perldata in passing, but if you're not familiar with the C API I'll grant that it's certainly open to causing confusion.


In reply to Re^3: is_numeric by Fletch
in thread is_numeric by tlm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found