Problems? Is your data what you think it is?  
PerlMonks 
Re: How can one generate all possible permutations of r elements out of n where r<n?by daxim (Chaplain) 
on Feb 26, 2013 at 12:31 UTC ( #1020680=note: print w/ replies, xml )  Need Help?? 
"uniform permutations" don't exist, at least not what you describe. Your number 4 is just the count of the elements of the input again, one does not need any algorithm to arrive at that conclusion.
In Section
Seekers of Perl Wisdom

