in reply to Permutations

You might also want to consult the Perl Cookbook recipe 4.19, it discusses solutions to generate all possible permutations of an array.