Title: Sorting question
Apologies to the list if this isn't plain text; my corp just switched to Exchange, and I can't force plain text!
 
Erich Beyrent wrote, on Tue 11/30/2004 10:53
: 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

==============================================================
          Joseph P. Discenza, Sr. Programmer/Analyst
               mailto:[EMAIL PROTECTED]
 
          Carleton Inc.   http://www.carletoninc.com
          574.243.6040 ext. 300    fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to