It seems to treat as an octal number, converts to decimal and then stringifies by the look of it.
$ perl -Mstrict -Mwarnings -MData::Dumper -E '
> my %hash = (
> 011 => q{nine},
> 11 => q{eleven},
> _2t => q{fruity},
> );
> print Data::Dumper->Dumpxs( [ \ %hash ], [ qw{ *hash } ] );'
%hash = (
'11' => 'eleven',
'_2t' => 'fruity',
'9' => 'nine'
);
$
$ perl -Mstrict -Mwarnings -MData::Dumper -E '
> my %hash = (
> 08 => q{eight},
> 11 => q{eleven},
> _2t => q{fruity},
> );
> print Data::Dumper->Dumpxs( [ \ %hash ], [ qw{ *hash } ] );'
Illegal octal digit '8' at -e line 3, at end of line
Execution of -e aborted due to compilation errors.
$
A zero on its own is fine.
Update: I'm an idiot, I meant to post as a reply to this :-(
|