perl - Iterating through hash -


i'm new in here , started learn perl, i'm trying access sub keys of hash this

my %hash = ( 'key' => {     'subkey1' => 'value1',     'subkey2' => 'value2', }); 

i'm trying in way....

  $key(%hash){       $sub_key(%key){            print $hash{$key}{$sub_key} 

  $key(keys %hash){         $sub_key(keys %{$hash{$key}}){              print $hash{$key}{$sub_key}          }   } 

and you're getting output value1value2...valuex


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -