in reply to Sorting question

Assuming you want a chronological sort of your timestamp rather than a lexical sort, you might try something like the following:

use DateTime::Format::Flexible; my @sorted = map { $_->{line} } sort { $a->{dt} <=> $b->{dt} or $a->{l} cmp $b->{l} } map { { dt => DateTime::Format::Flexible->parse_datetime( substr($ +_,0,24) ), l => substr($_,25,1), line => $_ } } @lines;