in reply to Re: Query about barewords
in thread Query about barewords
Empirically, the documentation seems to be a little inaccurate as the fat comma also seems to work if the word on the left starts with a number and consists only of numbers.
$ perl -Mstrict -Mwarnings -MData::Dumper -E ' > my %hash = ( > 1 => q{one}, > 11 => q{eleven} > ); > print Data::Dumper->Dumpxs( [ \ %hash ], [ qw{ *hash } ] );' %hash = ( '11' => 'eleven', '1' => 'one' ); $ $ perl -Mstrict -Mwarnings -MData::Dumper -E ' > my %hash = ( > 1 => q{one}, > 11 => q{eleven}, > 2t => q{fruity}, > ); > print Data::Dumper->Dumpxs( [ \ %hash ], [ qw{ *hash } ] );' syntax error at -e line 5, near "2t" Execution of -e aborted due to compilation errors. $ $ perl -Mstrict -Mwarnings -MData::Dumper -E ' > my %hash = ( > 1 => q{one}, > 11 => q{eleven}, > _2t => q{fruity}, > ); > print Data::Dumper->Dumpxs( [ \ %hash ], [ qw{ *hash } ] );' %hash = ( '11' => 'eleven', '1' => 'one', '_2t' => 'fruity' ); $
I hope this is of interest.
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Query about barewords
by runrig (Abbot) on Sep 06, 2012 at 15:53 UTC | |
by tye (Sage) on Sep 06, 2012 at 17:12 UTC |
In Section
Seekers of Perl Wisdom