tlm has asked for the wisdom of the Perl Monks concerning the following question:
Perl can handle arithmetic with strings, like '2x' and '3.e00.0.1.2y', consisting of a prefix that perl can recognize as a number followed by non-numeric stuff; for example
As far as I can tell1 this is an undocumented feature. Am I correct?% perl -wle 'print "2x" + "3.e00.0.1.2y"' Argument "3.e00.0.1.2y" isn't numeric in addition (+) at -e line 1. Argument "2x" isn't numeric in addition (+) at -e line 1. 5
the lowliest monk
1I've scanned perlnumber and perlop for documentation, without success, but, admittedly, I haven't been able to come up with a good grepping strategy for this search.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is '2x' + '3y' == 5 documented?
by itub (Priest) on May 31, 2005 at 02:26 UTC | |
by monarch (Priest) on May 31, 2005 at 02:31 UTC | |
|
Re: Is '2x' + '3y' == 5 documented?
by Tanktalus (Canon) on May 31, 2005 at 00:06 UTC | |
by tlm (Prior) on May 31, 2005 at 00:15 UTC |