Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: random num generator

by barrd (Canon)
on Jan 20, 2004 at 12:59 UTC ( [id://322574]=note: print w/replies, xml ) Need Help??


in reply to random num generator

Hi florrie,
Heres how I do it, you will probably get other suggestions too...

sub generateRandomNumber { my $len = shift || 12; my @chars = (0..9); return join '', map { $chars[ rand @chars ] } 1..$len; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (9)
As of 2024-04-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found