programming-examples/perl/SystemFunction/Seed rand with the time or the pid of this process.pl

9 lines
173 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
$num=10;
srand(time|$$);
while($num){
$lotto = int(rand(10)) + 1;
print "The random number is $lotto\n";
sleep 3;
$num--;
}