# Continue print with corresponding hash key and value for AsyncInNoTimingArc # Find the keys for which AsyncInNoTimingArc is in the value array my @keys = grep { my @array_CSV = @{$hash{$_}}; grep { $_ eq 'AsyncInNoTimingArc'} @array_CSV; } keys %hash; open (my $outfile1, '>>', "$outfile") or die "Unable to open $outfile: $!\n"; foreach my $key (@keys) { # Get the values corresponding to this key my $values = join(', ', @{$hash{$key}}); print <<" EOF"; pin(\"$key => {$values}\") { direction : input ; capacitance : $DIN_CAP ; } internal_power(pwr_arc){ values(\"$DIN_PWR_ARC\"); related_input : \"$key => {$values}\" ; } EOF }