Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: random number with range

by ikegami (Pope)
on Jun 01, 2006 at 18:06 UTC ( #553108=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @set = ( 1, 2, 3, 5, 8, 13, 21 );
    my $random = $set[rand(@set)];
    
  2. or download this
    my @set = qw( apple orange banana cucumber );
    my $random = $set[rand(@set)];
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://553108]
help
Chatterbox?
[1nickt]: Lightning poll: What would you do if stuck on the runway in a plane for seven hours because the airport lost power?
[marto]: If I was travelling with my twins, likely lose my mind :P

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-12-18 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (485 votes). Check out past polls.

    Notices?