Bug?

Jérôme Étévé jerome.eteve at gmail.com
Mon Dec 9 11:44:50 GMT 2013


Works for me..

I guess there's always a possibility 'shuffle' doesn't change the
order or the elements.

Maybe you're just very unlucky :) Or your 'random_order' function
evaluates to false for some reason.

J.

On 9 December 2013 11: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?



-- 
Jerome Eteve
+44(0)7738864546
http://www.eteve.net/


More information about the london.pm mailing list