in reply to Is '2x' + '3y' == 5 documented?

The only specific enough mention I've found so far is section 2.6 of the Camel book, 3rd edition, where it says
Perl converts between the various subtypes as needed, so you can treat a number as a string or a string as a number, and Perl will do the Right Thing. To convert from string to number, Perl internally uses something like the C library's atof(3) function.

Of course, that assumes that you are familiar with the atof function, which is described in the manpage as

double atof(const char *nptr);

The atof() function converts the initial portion of the string pointed to by nptr to double.

I have to recognize that the PHP documentation is more explicit in this regard; see for example http://www.php.net/manual/en/language.types.string.php#language.types.string.conversion

Replies are listed 'Best First'.
Re^2: Is '2x' + '3y' == 5 documented?
by monarch (Priest) on May 31, 2005 at 02:31 UTC
    I had an earlier post removed, presumably because I subconsciously knew this answer, but hadn't explicitly expressed it. (I had mumbled something along the lines of that this is the type of behaviour I would naturally expect).

    I suppose anyone with a good grounding in C would expect this answer.. it would only be a surprise to someone who hadn't used atof or atoi before that the '2x' + '3y' question would give a surprising answer.

    So, indeed, given that the Camel book explicitly states that atof is used, and given that atof is documented, it follows that this is indeed a documented feature of Perl. I will mod up the post to which this is a reply to.