Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

select random element from an array


srand ;                      # not needed for 5.004 and later
$index = rand @array
$element = $array [ $index ]