Hello monks. I am currently stuck with my code.

for $gate (@gates) { if (grep { $gate->{gate_level} eq '1' } @gates) { push @level_1_output, $gate->{output}->{wire_name}; %hash1 = ( $gate->{input_1}->{wire_name} => { CC0 => 1, CC1 => 1} + ); %hash2 = ( $gate->{input_2}->{wire_name} => { CC0 => 1, CC1 => 1} + ); %hash3 = ( $gate->{output}->{wire_name} => { CC0 => 0, CC1 => 0} +); print "CC0[", $gate->{input_1}->{wire_name},"]= ", $hash1{$gate-> +{input_1}->{wire_name}}{CC0}, "\n"; print "CC1[", $gate->{input_1}->{wire_name},"]= ", $hash1{$gate-> +{input_1}->{wire_name}}{CC1}, "\n\n"; print "CC0[", $gate->{input_2}->{wire_name},"]= ", $hash2{$gate-> +{input_2}->{wire_name}}{CC0}, "\n"; print "CC1[", $gate->{input_2}->{wire_name},"]= ", $hash2{$gate-> +{input_2}->{wire_name}}{CC1}, "\n\n"; if (grep { $gate->{gate_type} eq 'nand' } @gates) { $hash3{$gate->{output}->{wire_name}}{CC0} = $hash1{$gate->{inpu +t_1}->{wire_name}}{CC1} + $hash2{$gate->{input_2}->{wire_name}}{CC1} ++ 1; $hash3{$gate->{output}->{wire_name}}{CC1} = min($hash1{$gate->{ +input_1}->{wire_name}}{CC0} , $hash2{$gate->{input_2}->{wire_name}}{C +C0}) + 1; } print "CC0[", $gate->{output}->{wire_name},"]= ", $hash3{$gate->{ +output}->{wire_name}}{CC0}, "\n"; print "CC1[", $gate->{output}->{wire_name},"]= ", $hash3{$gate->{ +output}->{wire_name}}{CC1}, "\n\n"; $level_2_inputCC0 = $hash3{$gate->{output}->{wire_name}}{CC0}; $level_2_inputCC1 = $hash3{$gate->{output}->{wire_name}}{CC1}; push @CC0_value_1, $hash1{$gate->{input_1}->{wire_name}}{CC0}, $h +ash2{$gate->{input_2}->{wire_name}}{CC0}, $hash3{$gate->{output}->{wi +re_name}}{CC0}; push @CC1_value_1, $hash3{$gate->{output}->{wire_name}}{CC1}; $max_CC0_1 = max @CC0_value_1; print "$max_CC0_1\n"; } }
Shown above is a snippet of my program. After I'm done with pushing the values into array @CCO_value_1, I want to find the max value between those three values. However, I want to display the max value as well as the wire name that holds the value. Is it possible?

In reply to Max value by ameezys

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.