in reply to each on reference is experimental take 2

Strangely, when using each %{ $hoh->{ $sid } } I get the error

That's because you are trying to access the non-existent hashref $hoh instead of the existing hash %hoh.

# Hash, this is what you have my %hoh = ( ... ); # walk each key/value pair contained in the hash reference stored in $ +hoh{$sid} while ( my ( $key, $value ) = each %{ $hoh{$sid} } ) { ... } # Hash reference, what generated the error my $hoh = { ... }; # walk each key/value pair contained in the hash reference stored in $ +hoh->{$sid} while ( my ( $key, $value ) = each %{ $hoh->{$sid} } ) { ... }

Replies are listed 'Best First'.
Re^2: each on reference is experimental take 2
by natxo (Scribe) on Mar 10, 2016 at 20:08 UTC
    aha, thanks for your explanation, I think I got it.