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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |