I have an array of values. How can I sort these values that has
a non numeric character [ _ ] in it? What I did was parse the numbers
before the "_" character and then perform a number short on those
value, but there must be an easier way? Any help is greatly
appreciated.
55_20051202
56_20051203
57_20051204
101_20051205
59_20051206
10_20051207
61_20051208
62_20051208
63_20051208
64_20051209
65_20051209
66_20051210
67_20051211
68_20051212
69_20051213
70_20051214
One approach( Sorts by Date first aand then by the first set of digits ):
#!perl

use strict;
use warnings;


We need a better description of what you want the final sort to look like. The simplest approach is just
   sort {$a cmp $b}
which will sort the whole thing as alpha. Simple, but I assume not the order you want?

jps


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to