- or download this
if (@_ == 2) {
my ($type, $ref) = @_;
$type =~ s/_/-/g;
return sort { short_sorts($a, $b, $type) } @$ref;
}
- or download this
my @list = qw(red orange yellow green blue purple);
my @sorted = short_sorts ci_a => \@list;
print "@sorted\n";
# says "blue green orange purple red yellow"
- or download this
croak "$type is not supported"
if $type && !exists $sorts{$type};