in reply to When hashes aren't enough

OO - as other have said... 'it depends'. I find the question a little unclear, you have items with attributes...

Car Wheels=4 Doors=4 Color=Blue Bike Wheels=2 Color=Red
Which are easily encoded as hashes...
my %item = ( Car => { Wheels => 4, Doors => 4, Color => 'Blue', }, Bike => { Wheels => 2, Color => 'Red' }, );
but then you look for $Color{"Car"}... rather than $Item{Car}{Color}

so how exactly do you want to use $Item? Do you just want to store the details somewhere? or do you want attribute indexes...

my %item = ( Car => { Wheels => 4, Doors => 4, Color => 'Blue', }, Bike => { Wheels => 2, Color => 'Red' }, Moped => { Wheels => 2, Color => 'Blue' }, ); # build an index by attribute to item names... my %attr; for my $name ( keys %item ) { for my $token ( keys %{$item{$name}} ) { $attr{$token}{$item{$name}{$token}} ||= []; push @{$attr{$token}{$item{$name}{$token}}}, $name; } } print "Blue things: @{$attr{Color}{Blue}}\n";
Which is available on CPAN Tie-Hash-TwoWay

Regards,

Jeff