in reply to inner anonymous hash

You're close, but based on your desired data structure I think what you really want is a hash of a hash of arrays:

k1 => vname1 => [ v1, t1, f1 ] # note: I changed the () to [] vname2 => [ v2, t2, f2 ] k3 => vname3 => [ v3, t3, f3 ]

To create this type of structure, simply assign values like this:

# Assign an array (ref) to the HoH value $hash{$key}{$valname} $hash{$key}{$valname} = [ $value, $type, $flag ]; # option 1 @{ $hash{$key}{$valname} } = ( $value, $type, $flag ); # option 2
Given a $key and $valname, retrieve them like this:
my $type = ${ $hash{$key}{$valname} }[1]; # individual value my @array = @{ $hash{$key}{$valname} }; # all values
I prefer to use the bracket method of dereferencing (rather than the arrow method) because it helps me differentiate between object method calls and dereferences, but it adds keystrokes.

To print all of the data:

foreach my $key ( keys %hash ) { print "$key:\n"; foreach my $valname ( keys %{ $hash{$key} } ) { print " $valname: "; print join( "\t", @{ $hash{$key}{$valname} } ), "\n"; } }
Data::Dumper is very useful here, too:
use Data::Dumper; print Dumper( \%hash );

See the docs (perlref, perldsc) for more info.

HTH