Tips & Astuces
tips and tricks for computer and software
Search this blog
mercredi 17 février 2010
Perl: how to shuffle an array
If you either have Perl 5.8.0 or later installed, or if you have Scalar-List-Utils 1.03 or later installed, you can say:
use List::Util 'shuffle'; @shuffled = shuffle(@list);
Aucun commentaire:
Enregistrer un commentaire
Article plus récent
Article plus ancien
Accueil
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire