Just another Perl shrine | |
PerlMonks |
Re^5: making random numberby Ratazong (Monsignor) |
on Aug 25, 2014 at 07:59 UTC ( [id://1098499]=note: print w/replies, xml ) | Need Help?? |
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).
In Section
Seekers of Perl Wisdom
|
|