in reply to manipulating array

Given that you're going to want to look at the date anyway, you might as well pick your data apart into columns. If you're sure that you'll have no whitespace in your 'moredata', you could just do a split without a limit, but to play it safe I'll just split the first few columns (untested):
# Each eat of splitLines will hold an array ref my @splitLines; foreach my $line (@calls) { my @bits = split(/\s+/, $line, 4); # Discard the first column shift @bits; # We want to sort by date, so we'll parse # the date column and prefix with a sortable value my ($mday, $month, $year) = split(m!/!, $bits[1]); $month -= 1; # mktime wants month from 0 $year += 100; # mktime wants year from 1900 my $when = POSIX::mktime(0, 0, 0, $mday, $month, $year); unshift @bits, $when; push @splitLines, [ @bits ]; } # Sort by first elt @splitLines = sort { $a->[0] <=> $b->[0] } @splitLines; # And puts the lines back together again (discarding # the leading 'when'. @calls = map { shift @$_; join(' ', @$_) } @splitLines;
This seems over-long, but unless you write a more complex sort comparator (and hide the date parsing and processing etc in there) I'm not sure it can get much shorter. I don't like debugging complex sort comparators, so there you go.