Bug?

Jasper jaspermccrea at gmail.com
Mon Dec 9 12:14:48 GMT 2013


If the original list is 2 elements, it's 50:50 that you'll get the original
back. Is that the problem? :)


On 9 December 2013 11:49, Joel Bernstein <joel at fysh.org> wrote:

> Assuming you didn't make a typo, don't forget that the original
> configuration is one possible shuffling of the set...
>
>
> On 9 December 2013 12:23, Kieren Diment <diment at gmail.com> wrote:
>
> > In a short subroutine, this:
> >
> >     use List::Util qw/shuffle/;
> >     my @list = @{$self->answer_list_orig_order};
> >     @list = shuffle @list if $self->random_order;
> >     return \@list;
> >
> > does what's expected.  Returns the shuffled list.
> >
> > This:
> >
> > use List::Util qw/shuffle/;
> > my @list = @{$self->answer_list_orig_order};
> > @list = shuffle @list if $self->random_order;
> > return \@list
> >
> > returns the list unshuffled.
> >
> > What's up with that?
> >
> >
>



-- 
Jasper


More information about the london.pm mailing list