note
AppleFritter
<p>
Funny that not redirecting the output makes such a big difference on your machine. For me, your code takes ~0.06 seconds to run when redirecting to <tt>/dev/nul</tt>, and ~0.11 seconds if not.
</p><p>
Be that as it may, thanks for the pointer to [mod://Algorithm::Combinatorics] and the code snippet, this looks like a very useful module! And (redirecting to <tt>/dev/nul</tt>, again) I'm getting running times of ~0.5s, ~2.9s, ~12.1s, ~40.6s for <tt>@data</tt> sizes of 4, ..., 7, which is very reasonable.
</p><p>
<b>EDIT</b>: Of course, what I was actually looking for was multisets, not ordered tuples (did you read my post?), but fortunately [mod://Algorithm::Combinatorics] also offers a <tt>combinations_with_repetition</tt> function for that. Funny that I completely missed this module when looking at CPAN earlier today, too.)
</p>
1198509
1198511