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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -