more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm working on a project which uses TheSchwartz, and I saw that it was supposed to work with multiple databases. I was not sure how it would maintain some of it's stuff over more than one database, so I tested it - and found that all the stuff kept going to the same database server. I looked at the source, and found that it's routine for shuffling databases uses Util::List, and so I tested it: That gave me:
1,2,3,4,5,6,7,8,9,10
The shuffle routine in List::Util looks reasonable at first glance:
1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 1,2,3,4,5,6,7,8,9,10 Personally, I'm never comfortable using floating point values for array indices, but perhaps there's a perl magic at work that I don't understand. At any rate, either there's a bug in shuffle, or something is very wrong with my random generator - or am I, along with the author of TheSchwartz using List::Util::shuffle incorrectly? In reply to Bug in List::Util::shuffle ? by matija
|
|