Help for this page
$i = 0; %L = map { $_ => $i++ } @L; @Ss = sort { $L{$a} <=> $L{$b} } @S;
@L = qw(one two three four five six seven eight); @S = qw(eight one five three); @Ss = qw(one three five eight);