Perl: the Markov chain saw | |
PerlMonks |
Re^5: Add a fixed number of unique elements to hash [sample() vs. shuffle()]by kcott (Archbishop) |
on Mar 07, 2023 at 12:07 UTC ( [id://11150825]=note: print w/replies, xml ) | Need Help?? |
G'day hippo, ++ Thanks for checking that out. I ran a verbatim copy of your one-liner four times and got a different result each time; so, on the face of it, this seems to be working correctly (with v1.62 & v1.63). I did actually sit down to run some tests yesterday; unfortunately, real-life barged in and the testing needed to take a backseat. I will get to it eventually. I'm fairly certain that I didn't change any logic when moving from sample to shuffle. I recall only a very minor modification; probably just these two lines (off the top of my head):
I'll post more when I get to the testing. It's 11pm here now, so that won't be tonight. :-) — Ken
In Section
Seekers of Perl Wisdom
|
|