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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||