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

Re^5: making random number

by Ratazong (Monsignor)
on Aug 25, 2014 at 07:59 UTC ( [id://1098499]=note: print w/replies, xml ) Need Help??


in reply to Re^4: making random number
in thread making random number

print "0912$random_number\n";

This works (look at the small difference to your solution). However if the random-number is less than 10, it will give you a 5-digit-number instead of a 6-digit-number. That issue may be circumvented by the approach shown by CountZero below (adding 91200 to your random number).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found