Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^6: Perl - Unique Numbers

by dsheroh (Monsignor)
on Oct 19, 2015 at 12:06 UTC ( [id://1145318]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (keys %numbers < 10) {
      my $num = int( rand 20 ) + 1;
      $numbers{$num}++;
    }
    
  2. or download this
    $numbers{int(rand(20))+1}++ while keys %numbers < 10;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1145318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-19 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found