my $i; my %order = map {$_ => ++$i} qw(R A F U S W); say for sort {$order{$a} <=> $order{$b}} qw(U F S)