Current location: Hot Scripts Forums » Programming Languages » Perl » Sorting times


Sorting times

Reply
  #1 (permalink)  
Old 01-01-04, 02:10 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
Sorting times

Lets say i have a list of these times:

01:02:05
01:02:01
01:02:03

They are not in order, so how do i get perl to sort them into

01:02:01
01:02:03
01:02:05
Reply With Quote
  #2 (permalink)  
Old 01-01-04, 04:05 PM
YUPAPA's Avatar
YUPAPA YUPAPA is offline
Newbie Coder
 
Join Date: Sep 2003
Location: Antarctica
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Quote:
Originally Posted by perleo
Lets say i have a list of these times:

01:02:05
01:02:01
01:02:03

They are not in order, so how do i get perl to sort them into

01:02:01
01:02:03
01:02:05
Code:
my @times       =       ('01:02:05','01:02:01','01:02:03');
print "$_\n"    foreach (sort @times);
__________________
YuPaPa.CoM is my home ~
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP Custom Tags and Client Side Table Sorting kamwingpang JavaScript 3 12-11-03 12:48 PM
allow times like 18:34:78 perleo PHP 0 09-15-03 02:14 PM
sorting multiple tables elmeto PHP 1 08-13-03 09:07 AM
Mail Script sending multiple times when Table has a lot of data dsumpter PHP 12 07-16-03 05:17 PM
New Sorting Formula In Place relledge Announcements 0 06-21-03 02:17 PM


All times are GMT -5. The time now is 04:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.