From owner-freebsd-questions Mon Nov 12 11: 9:50 2001 Delivered-To: freebsd-questions@freebsd.org Received: from marlo.eagle.ca (marlo.eagle.ca [209.167.16.10]) by hub.freebsd.org (Postfix) with ESMTP id 3518637B405 for ; Mon, 12 Nov 2001 11:09:48 -0800 (PST) Received: from phantom (staff.eagle.ca [209.167.16.15]) by marlo.eagle.ca (8.11.3/8.11.3) with SMTP id fACJ4PO49439; Mon, 12 Nov 2001 14:04:26 -0500 (EST) (envelope-from freymann@scaryg.shacknet.nu) Message-ID: <026001c16bad$ae034a50$0f01a8c0@phantom> From: "Gerald T. Freymann" To: "Andre` Niel Cameron" , "free bsd" References: <00b801c16baa$6f4bde60$a50410ac@olmct.net> Subject: Re: Perl Question Date: Mon, 12 Nov 2001 14:10:23 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Anyone know how to generate a random number in perl so I can stick it in a > variable? How about: $myvar = rand(10); where 10 is the highest number to use, so $myvar would come back as a random number between 0 and 10. OR: $myvar = srand(value); srand accepts an integer value as an arguement; if no arguement is supplied, srand calls the time function and uses its return value as the random-number seed. gf To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message