in reply to Re: Random distribution
in thread Random distribution

I suggested using List::Util below, and was just curious (since you recommended the Algorth::... module) do you see significant tradeoffs for either of those modules? I haven't done any benchmarking, but thought you might have some idea.

Replies are listed 'Best First'.
Re: Random distribution
by Abigail-II (Bishop) on Oct 24, 2003 at 20:00 UTC
    The Algorithm::Numeric::Shuffle is a pure Perl solution. I wrote it years ago, 5.005 era I guess. The one in List::Util is in XS and should be much faster than the one in Algorithm::Numeric::Shuffle. I'd go for the one in List::Util, unless you have an old version of Perl and can't easily build XS modules yourself.

    Abigail

Re: Re: Re: Random distribution
by hardburn (Abbot) on Oct 24, 2003 at 20:06 UTC

    No reason beyond the fact that it was the first thing thing that came up on search.cpan.org for the term 'shuffle'. If List::Util is XS, it's almost certainly faster, so that probably is a better module to use.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    :(){ :|:&};:

    Note: All code is untested, unless otherwise stated