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
Post a Comment