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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |