Now that I think of it, it can be greatly simplified:
sub prepare_sort {
return [ $_, tr/aeiou/z/cr, tr/aeiou//dr ];
}
Thanks to Zucan for the tip!
So we dont need a sub now:
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
my @words = qw( xaxexix babebib xaxexi babebibb baebbib );
say for map $_->[0],
sort { $a->[2] cmp $b->[2] } # vowels sort
sort { $a->[1] cmp $b->[1] } # positional sort
sort { $a->[0] cmp $b->[0] } # alphabetical sort
map [ $_, tr/aeiou/z/cr, tr/aeiou//dr ],
@words;