View Single Post
  #12  
Old 06-10-2004, 12:24 PM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

BTW, for looking up perl functions, I usually use http://www.perldoc.com/perl5.6/pod/perlfunc.html. If you want to get non-contiguous values, you're probably best off putting them all into an array, and then choosing an array index at random.

edit: See if this works for you..

Code:
sub getrand
{
  return $_[rand @_];
}

$x = getrand (1002, 3023, 91982);
print "item is $x\n";
Reply With Quote