|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I need a short script that will generate a random number that is five digits long. It only needs to be pseudo-random - int(rand()+1) works fine, but I do not know how to get it to return me 5 digits at all times. Thanks,
Joe |
|
#2
|
|||
|
|||
|
ummm... for loop, and append (.= operator) to the string....
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by habiem: I need a short script that will generate a random number that is five digits long. It only needs to be pseudo-random - int(rand()+1) works fine, but I do not know how to get it to return me 5 digits at all times. Thanks, Joe[/quote] |
|
#3
|
|||
|
|||
|
$random = (rand 9999) + 10000;
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Random Numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|