in reply to Which Permute or other module can give me all possible subsets of 6 numbers out of 40?
your answer is in the tartaglia's triangle aka pascal one
n! C(n,k) = ---------- k!(n-k)!
is the basic formula to get your answer. To get some code search for tartaglia and pascal here at the monastery or look here.
If you want a module you can look at Math::Combinatorics too
L*
|
|---|