Confused...My previous code just traverse till the end of DATA and just displays the end data. Its not performing what I am willing to do.

my $x=0; while(<DATA>){ next unless /\w/; my($server,$datetime,$metric,$value) = (split)[0,1,2,3]; $value =~ s/,//g ; my $ddhh = substr $datetime,0,13; my $dd = substr $datetime,0,10; $d{$dd }{$server}{$metric}{max} = ($x < $value) ? $value : $x; $d{$dd }{$server}{$metric}{min} = ($x > $value) ? $value : $x ; $h{$ddhh }{$server}{$metric}{max} = ($x < $value) ? $value : $x; $h{$ddhh }{$server}{$metric}{min} = ($x > $value) ? $value : $x ; $ser{$server} = 1; $met{$metric} = 1; }

In above code $x < $value always holds true and just traverse till end of DATA...it doesn't find the maximum value. If you don't mind can you please provide me the pseudo-code OR any hints to achieve it?


In reply to Re^6: Analytics on Hash Arrays by yasser8@gmail.com
in thread Analytics on Hash Arrays by yasser8@gmail.com

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.