No such thing as a small change | |
PerlMonks |
curious behavior: why does it do this?by perl-diddler (Chaplain) |
on Nov 27, 2018 at 23:09 UTC ( [id://1226434]=perlquestion: print w/replies, xml ) | Need Help?? |
perl-diddler has asked for the wisdom of the Perl Monks concerning the following question:
I playing with the syntax of ranges, like my $h={args=>[0..5]}, my $h={args=>[0..-1]} and a few others, I came up with a range that surprised me: my $h={args=>["0".."-1]}
Using P::P to print the value, as it's made for cases like this (1st, the more normal cases, then the odd one:
So a quoted 0 started with 0, and a double zero ended up with a leading zero for 0-9, but the odd part was the "-1" turning into "99". Huh? That's weird. Why does it do that? Thanks...
Back to
Seekers of Perl Wisdom
|
|