#!/usr/bin/perl

@data = qw(Durian Cherry  Apple   Eggplant Banana);

@i = sort {$data[$a] cmp $data[$b]} (0..$#data);
@r = sort {$i[$a] <=> $i[$b]} (0..$#data);

$\ = "\n";
$, = ", ";

print @i;
print @data[@i];

print @r;
print @data[@r];
