in reply to Re: Brain muchly befuddled by nested hashes
in thread Brain muchly befuddled by nested hashes
Based on looking at the OP's output from Data::Dumper (and on trying it myself), it seems that perl is not adding any sort of field delimiter in the hash key:
That said, I would agree that presence of the "fat comma" (=>) as part of the hash-key expression looks like a misunderstanding (and/or could be misunderstood by less skilled readers), and is rather ugly as well. Something like simple concatenation or string interpolation would be clearer ($hash{'string'.$num} or $hash{"string$num"}).perl -le '$n=0; $h{"foo"=>$n++}=$n for (0..3); print "$_ => $h{$_}" fo +r (sort keys %h)' foo0 => 1 foo1 => 2 foo2 => 3 foo3 => 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Brain muchly befuddled by nested hashes
by ysth (Canon) on Nov 24, 2008 at 06:05 UTC |