in reply to Searching for a Permutation Algorithm for nPr where n != r

If you are only choosing two elements at a time, a simple solution may be best:
my @arr = (1..100); foreach my $i (0..@arr-1) { foreach my $j (0..@arr-1) { next if $i == $j; print "$arr[$i],$arr[$j]\n"; } }
if r > 3 or so, tye's solution is good for more general cases.

-Mark