perl v5.18.2 came after perl v5.7.3, so yes, it should be installed for you. However, the name is List::Util, not list::utils. The following shows that list::utils doesn't exist, but that List::Util exists and has been in core since v5.7.3:

pryrt@debianvm:~$ perl -Mlist::utils -le 'print "OK"' Can't locate list/utils.pm in @INC (you may need to install the list:: +utils module) (@INC contains: ./blib/lib /home/pryrt/perl5/perlbrew/p +erls/perl-5.20.3/lib/site_perl/5.20.3/i686-linux /home/pryrt/perl5/pe +rlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3 /home/pryrt/perl5/perlb +rew/perls/perl-5.20.3/lib/5.20.3/i686-linux /home/pryrt/perl5/perlbre +w/perls/perl-5.20.3/lib/5.20.3 .). BEGIN failed--compilation aborted. pryrt@debianvm:~$ perl -MList::Util -le 'print "OK"' OK pryrt@debianvm:~$ corelist List::Util Data for 2015-09-12 List::Util was first released with perl v5.7.3

... Besides, if your example code, which included use List::Util 'shuffle'; compiled at all, then you already knew you had it installed properly.

Oh, there, that's what you're doing wrong: @trips = join(" ", @trips);. You just replaced the contents of the @trips array with a single value, which is a string which joins all the old elements of @trips with a space. I think what you want is more akin to:

#!/usr/bin/env perl use warnings; use strict; print "enter sequence and signal end with enter followed by ctrl d\n"; my $sequence = <STDIN>; chomp $sequence; print "sequence inserted : $sequence\n"; my @trips = unpack("a3" x (length($sequence)-2), $sequence); local $" = ", "; print "unshuffled: (@trips)\n"; use List::Util 'shuffle'; my @shuffled = shuffle(@trips); print "shuffled: (@shuffled)\n"; __END__
__RESULTS__ enter sequence and signal end with enter followed by ctrl d GATTACCAT sequence inserted : GATTACCAT unshuffled: (GAT, TAC, CAT, , , , ) shuffled: (, , GAT, TAC, CAT, , )

In reply to Re^3: Shuffling codons by pryrt
in thread Shuffling CODONS by WouterVG

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.