One thing I noted that seems a bit perverse (or wrong). Is how I'm printing out the numbers 08 and 09, which under perl would fail as numbers. My print routine,
P looks at what it is printing for list members and automatically quotes non-numeric entities, while not quoting numbers. So is it wrong to leave out those quotes around 08 and 09? I shouldn't feel too horrible, as
Scalar::Util's function "
looks_like_number" also think 08/09 are numbers -- as does perl itself:
> tperl
use Scalar::Util qw(looks_like_number);
for my $i ("00".."10") {
P "%s(%d) %s like a number", "$i", "$i", looks_like_number($i) ? "look
+s":"does not look";
}'
00(0) looks like a number
01(1) looks like a number
02(2) looks like a number
03(3) looks like a number
04(4) looks like a number
05(5) looks like a number
06(6) looks like a number
07(7) looks like a number
08(8) looks like a number
09(9) looks like a number
10(10) looks like a number
So nothing about invalid octal constants from perl. ... *Ouch*, on a whim, I tried inserting a 0 before the 10, thinking my list iteration _might_ stop at 8, I.e.:
for my $i ("00".."010") {...
I got an enumeration up through 999. Another unexpected result! Or is that really what others expected?
Perhaps as a nod to sanity, using 010 (with no quotes) as an end-value did end at 8, but the entire sequence was numified (with the leading 0 missing):
0(0) looks like a number
1(1) looks like a number
2(2) looks like a number
3(3) looks like a number
4(4) looks like a number
5(5) looks like a number
6(6) looks like a number
7(7) looks like a number
8(8) looks like a number