want to see something fugly?
I found a way to output in a specified order ;)
but god it is FUGLY!

sub generate_stats () {

printf "%s,", scalar localtime();
printf "%d,%d,%d,%d,", $results{'ORA-'},$results{'Fault
2-001'},$results{'Fault 2-002'},$results{'Fault 2-003'};
printf "%d,%d,%d,%d,", $results{'Fault 2-004'},$results{'Fault
2-005'},$results{'Fault 2-006'},$results{'Fault 2-007'};
printf "%d,%d,%d,%d,", $results{'Fault 2-008'},$results{'Fault
2-009'},$results{'Fault 2-010'},$results{'Fault 2-011'};
printf "%d,%d,%d,",    $results{'Fault 2-012'},$results{'Fault
2-013'},$results{'Fault 2-015'};
printf "%d,%d,%d,",
$results{'\\w+Bin\\w+Factory'},$results{'SystemException'},$results{'\\w+Com
munication\\w+failure'};
printf "%d,%d,%d,%d,%d",    $results{'\\w+ORBA'},$results{'Get Q
Error'},$clients,$pricing,$results{'Test App Finished'};
printf ",%1.5f", $smtx / $syscl;
printf ",%1.3f", $usr / ($usr + $sys + $wt + $idl);
printf ",%1.3f", $sys / ($usr + $sys + $wt + $idl);
printf ",%1.3f", $wt / ($usr + $sys + $wt + $idl);
printf ",%1.3f,%d\n", $idl / ($usr + $sys + $wt + $idl), $avg;

}

yeah yeah yeah... I'm a newb so sue me!



> -----Original Message-----
> From: Jos I. Boumans [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 21, 2001 3:36 PM
> To: [EMAIL PROTECTED]; Yacketta, Ronald
> Cc: Beginners (E-mail)
> Subject: Re: output in specified order
> 
> 
> You could probably use a Schwartzian on this, to order the 
> keys or values of
> a hash by something...
> i have no clue how bad your performance will be, but you 
> might want to look
> into it
> it's in perlfaq 4
> 
> hth
> Jos Boumans
> 
> ----- Original Message -----
> From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
> To: "Yacketta, Ronald" <[EMAIL PROTECTED]>
> Cc: "Beginners (E-mail)" <[EMAIL PROTECTED]>
> Sent: Thursday, June 21, 2001 9:04 PM
> Subject: Re: output in specified order
> 
> 
> > On Jun 21, Yacketta, Ronald said:
> >
> > >I have a the following hash that _MUST_ be outputed in a 
> specified order
> > >every time.
> >
> > You see, that's an ugly combination.  You might find a 
> pseudohash useful,
> > but they're kinda ugly.  Perhaps you want the Tie::IxHash module.
> >
> > --
> > Jeff "japhy" Pinyan      [EMAIL PROTECTED]      
http://www.pobox.com/~japhy/
> I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
> Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
> Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
> Acacia Fraternity, Rensselaer Chapter.         Brother #734
> **      Manning Publications, Co, is publishing my Perl Regex book      **
>
>

Reply via email to