in reply to Is '2x' + '3y' == 5 documented?
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 |