Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Bug in List::Util::shuffle ?

by friedo (Prior)
on Dec 06, 2008 at 14:50 UTC ( #728556=note: print w/ replies, xml ) Need Help??


in reply to Bug in List::Util::shuffle ?

You're shuffling a one-element list containing an array reference, then dereferencing that. A one-element list has only one possible order.

Try this instead:

perl -e 'use List::Util qw(shuffle); @a=(1,2,3,4,5,6,7,8,9,10); foreac +h (1..24) { print join(",",shuffle(@a) )."\n"}'


Comment on Re: Bug in List::Util::shuffle ?
Download Code
Replies are listed 'Best First'.
Re^2: Bug in List::Util::shuffle ?
by matija (Priest) on Dec 06, 2008 at 14:54 UTC
    Aaaggghhh! You're right! I hate it when I do something stupid like that...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://728556]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2015-07-08 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls