Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Whatever happened to chomp?

by ysth (Canon)
on Dec 14, 2003 at 17:01 UTC ( [id://314651]=note: print w/replies, xml ) Need Help??


in reply to Whatever happened to chomp?

In numeric context, perl will not warn if a number matches something like:
/^(?: 0\ but\ true | (?: \s* # leading spaces ignored [-+]? # optional sign (?: (?i: inf|infinity|nan ) | # any case of inf or nan (?: \d+ (?:\.\d*)? | \.\d+ ) # digits, optional . (?: [eE] [-+]? \d+ )? # optional exponent ) \s* # trailing spaces (including "\n") ) )\z /x;
The case you are hitting is the "trailing spaces" being silently ignored.

If compiled with numeric locale support, either . or the locale's radix will work.

Log In?
Username:
Password:

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

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

    No recent polls found