in reply to Multidimesional hashs in Perl, C++, C# and Perl6

If you had used while( each ), you would have direct access to values (but I suppose that you already know that), similar to your Perl 6 syntax. For completeness sake ...

my %hash = ( 'B' => { 'A' => 4 , 'B' => 8 } ); while ( my ( $k , $v ) = each %{ $hash{'B'} } ) { print "$k : $v\n"; }

Replies are listed 'Best First'.
Re^2: Multidimesional hashs in Perl, C++, C# and Perl6
by Util (Priest) on May 10, 2007 at 20:46 UTC
    Shortened using the new placeholder variables:
    my %hash = ( A => { A => 1, B => 2 }, B => { A => 4, B => 8 }, ); say "$^k - $^v" for %hash<B>.kv;