Dennis, Not to tell you how to run your business, but how is the date formatted in the array? It has been my experience in working with dates that they should be formatted as 20040202. This allows you to sort on years that are different. Eric ----- Original Message ----- From: "Dennis G. Wicks" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 02, 2004 1:49 PM Subject: Need help sorting by specific fields in file.
> Greetings; > > I have a file that I need to sort and currently I am just > sorting it by > > @datalist = sort(@datalist); > > but it will eventually have many more records and many of > them may be quite large, but I only need to sort on the > first six characters which would be faster. Wouldn't it? > > I have looked at perldoc and it shows things like > > @articles = sort {$a <=> $b} @files; > > but I can't figure out how to tell the sort that $a and $b > are the first six characters of @datalist. That is numeric > data BTW. > > Any help or pointers appreciated. > > Dennis > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>