Here: ehm_count is the hash that I want it to be local to the main procedure and same needs to be used during recursive calls as well . I dont see it happening. Please help. Thanks, -Karthiksub get_lower_level_ehms_count() { my %design_hash = %{@_[0]}; local %ehm_count; ##Checking if the design has embedded SMSes if($design_hash{'EMBEDDED_HMS'}) { my @ehms = @{$design_hash{'EMBEDDED_HMS'}}; ##Getting +the list of EHMs under the current DHM foreach(@ehms) { my %ehm_hash = %{$_}; my $design_top = $ehm_hash{'TOP'}; if($ehm_hash{'EMBEDDED_HMS'}) { &get_lower_level_ehms_count(\%ehm_hash +); } if(!($ehm_count{$design_top})) { $ehm_count{$design_top} = @{$ehm_hash{ +'INSTANCES'}}; } else { my $count = $ehm_hash{$design_top}; my $instances = @{$ehm_hash{'INSTANCES +'}}; $count = $count + $instances; $ehm_count{$design_top} = $count; } } } return \%ehm_count; }
In reply to Updating a same hash using recurrsion ... by mvkarthik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |