Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

randomly extract from an array until all are gone


for  (0 .. $ #myarray) {   #
    $index = int ( rand $ #myarray);
    print $myarray [ $index ] ;
    splice @myarray , $index , 1
}