> On Jun 9, 2018, at 12:42 AM, ToddAndMargo <[email protected]> wrote:
—snip--
> Yippee!! Thank you!
>
> $ ls | perl6 -e 'my @x=lines(); for @x.sort: {my ($month, $day, $year,
> $hour, $minute, $second) = .comb(/\d+/);($year // 0, $month // 0, $day // 0,
> $hour // 0, $minute // 0,$second // 0, $_);} -> $Line {say $Line};'
> cimtrak.log.12-08-2016_06:07:39.zip
> cimtrak.log.06-08-2018_16:07:39.zip
> cimtrak.log.06-08-2018_17:07:39.zip
> cimtrak.log.07-08-2018_06:07:39.zip
> cimtrak.log.07-08-2018_16:07:39.zip
I see this is well solved, but here is Yet Another Way to do it:
ls | perl6 -e '.say for lines().sort: {
( (/ (\d\d)"-"(\d\d)"-"(\d\d\d\d)"_"(\d\d)":"(\d\d)":"(\d\d) / ??
"$2$0$1$3$4$5" !! ""), $_ )
}'
—
Hope this helps,
Bruce Gray (Util of Perlmonks)