CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [2bevil1] Unique numbers: Edit Log



KevinR
Veteran


Mar 6, 2008, 3:54 PM


Views: 2619
Re: [2bevil1] Unique numbers

I wrote that bit of perl code you posted that uses the hash to generate the random numbers. It's a snippet I posted on dreamincode.com in a little while back.

You have too many arguments in the rand($a,$b) function, there should only be one arguments. If you want numbers 1 to 47 it should be:

rand(47)

that should get your script to run but it will not generate unique numbers.
-------------------------------------------------


(This post was edited by KevinR on Mar 6, 2008, 4:03 PM)


Edit Log:
Post edited by KevinR (Veteran) on Mar 6, 2008, 3:57 PM
Post edited by KevinR (Veteran) on Mar 6, 2008, 4:03 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives