On 06/08/2018 07:00 PM, Brent Laabs wrote:
let me revise that

@x.sort: {
   my $a = $^a ~~ m:g/\d+/;
   my $b = $^b ~~ m:g/\d+/;
   $a[6].defined cmp $b[6].defined
   ??
     $a[3] cmp $b[3]
   || $a[1] cmp $b[1]
   || $a[2] cmp $b[2]
   || $a[4] cmp $b[4]
   || $a[5] cmp $b[5]
   || $a[6] cmp $b[6]
   || $^a cmp $^b
   !! $^a cmp $^b
};



$ ls | perl6 -e 'my @x=slurp(); @x.sort: { my $a = $^a ~~ m:g/\d+/;my $b = $^b ~~ m:g/\d+/;$a[6].defined cmp $b[6].defined ?? $a[3] cmp $b[3] || $a[1] cmp $b[1] || $a[2] cmp $b[2] || $a[4] cmp $b[4] || $a[5] cmp $b[5] || $a[6] cmp $b[6] || $^a cmp $^b !! $^a cmp $^b a cmp $^b' $^a cmp $^b
===SORRY!=== Error while compiling -e
Redeclaration of symbol '$^a' as a placeholder parameter
at -e:1
------> my @x=slurp(); @x.sort: { my $a = $^a⏏ ~~ m:g/\d+/; my $b = $^b ~~ m:g/\d+/;$a

Reply via email to