in reply to How to create multiple keys in a hash
Will a nested hash structure do what you want?
$somehash{foo}{bar}{baz}++; $somehash{quux}{wibble}{42}++; foreach $x (keys %somehash) { foreach $y (keys %{$somehash{$x}}) { foreach $z (keys %{$somehash{$x}{$y}}) { print "There were $somehash{$x}{$y}{$z} ". "occurrances of $x,$y,$z\n"; } } }
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to create multiple keys in a hash
by tanuja (Initiate) on Sep 21, 2003 at 00:47 UTC | |
by jonadab (Parson) on Sep 21, 2003 at 01:22 UTC |