I'm not sure I captured exacttly which min and max you wanted, but this code should get you started on the right track:
use strict; use warnings; my %timing1; my %minmax; chomp ($_=<DATA>); # Hdr my @hdr = split /\s+/; # Not used while (<DATA>){ chomp ; s/^\s+//; my @r=split /\s+/; $timing1{$r[1]}{$r[2]}{$r[3]}{$r[0]}=$r[4]; $minmax{"$r[3]"}{MIN} ||= 9e9; $r[4] < $minmax{$r[3]}{MIN} and do{$minmax{$r[3]}{MIN} = $r[4]; $min +max{$r[3]}{MINNAME} = $r[0]}; $minmax{$r[3]}{MAX} ||= -9e9; $r[4] > $minmax{$r[3]}{MAX} and do{$minmax{$r[3]}{MAX} = $r[4]; $min +max{$r[3]}{MAXNAME} = $r[0]}; } foreach my $rName ( keys %timing1 ) { foreach my $tType ( sort keys %{$timing1{$rName}}) { foreach my $rF ( sort keys %{$timing1{$rName}{$tType}}){ + my @by_val = map {[$timing1{$rName}{$tType}{$rF}{$_},$_]} + keys %{$timing1{$rName}{$tType}{$rF}}; @by_val = sort { $a->[0] <=> $b->[0]} @by_val; foreach my $aref ( @by_val) { my ($val, $pinName) = @$aref; print " $pinName\t $rName\t $tType\t $rF\t $val \n"; } } } } # Min and Max ... for my $k (sort keys %minmax){ print " $minmax{$k}{MINNAME} $k \t Min=", $minmax{$k}{MIN}, "\t $minmax{$k}{MAXNAME} Max=", ($minmax{$k}{MAX} ) , "\t Spread=", ($minmax{$k}{MAX} - $minmax{$k}{MIN} ) , "\n"; } __DATA__ pin Name related_pin time_type rise_fall delay DQ5_RX_CLK M2CLKP c_rise rise_transition 0.014446 DQ2_RX_CLK M2CLKP c_rise rise_transition 0.014464 DQ0_RX_CLK M2CLKP c_rise rise_transition 0.014452 DQ3_RX_CLK M2CLKP c_rise rise_transition 0.014452 DQ7_RX_CLK M2CLKP c_rise rise_transition 0.014430 DQ4_RX_CLK M2CLKP c_rise rise_transition 0.014446 DQ8_RX_CLK INT_CLK c_fall fall_transition 0.199360 DQ6_RX_CLK INT_CLK c_fall fall_transition 0.199322 DQ1_RX_CLK INT_CLK c_fall fall_transition 0.199500 DQ5_RX_CLK INT_CLK c_fall fall_transition 0.199248 DQ2_RX_CLK INT_CLK c_fall fall_transition 0.199368

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992


In reply to Re^5: Sorting Multilevel Hashes by NetWallah
in thread Sorting Multilevel Hashes by newCoder

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.