: I have the following data structure:
:
: $hash{$connid} = {"month"   => $month,
:                     "day"     => $day,
:                     "time"    => $time,
:                     "user"    => $user,
:                     "host"    => $host,
:                     "from_ip" => $from_ip,
:                    };
:
: The time (where time is in hh:mm:ss format) and there could be a few
entries
: with the same user and same timestamp - I only wish to display the first
: one.
: 
: So this works just fine.  The problem is that I need to also sort the
: results by month, day, and time.  It looks as if the month and day fields
: are sorting, but not the time field, and I am unsure as to how to sort
this.
: 
: What do you mean by "not the time field?" Perhaps you need to use "cmp"
instead of "<=>" (maybe you are; you : 
: didn't show any sorting code!) since there are embedded colons, or you
need to make sure your hours before 10 
: have leading zeros so they sort correctly ("hh:mm:ss" implies that they
already do, but maybe you didn't mean 
: that).
:  
: Joe

Sorry for not being specific enough.  The data gets displayed with the times
in no particular order.  I might have:

10:02:34
06:05:01
09:00:01

Etc.  I agree that cmp would have to be used instead of <=>, but I am not
sure as to how to implement this kind of sort on a single hash key when I am
doing a foreach loop on all the keys.  Any assistance would be greatly
appreciated!

Best regards,

-Erich-

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to