Help for this page

Select Code to Download


  1. or download this
    sub permutation {
        my ($perm,@set) = @_;
    ...
    }
    my @input = (qw/a b c d/);
    permutation('',@input);
    
  2. or download this
    permutation($perm.$set[$_],@set[0..$_-1],@set[$_+1..$#set]) foreach (0
    +..$#set);