programming-examples/perl/SystemFunction/Formula to produce random numbers between 5 and 15 inclusive.pl
2019-11-15 12:59:38 +01:00

13 lines
263 B
Perl

#!/usr/bin/perl
$x=5 ;
$y=15;
# Formula to produce random numbers between 5 and 15 inclusive
# $random = int(rand($y - $x + 1)) + $x;
# $random = int(rand(15 - 5 + 1)) + 5
while(1){
print int(rand($y - $x + 1)) + $x , "\n";
sleep 1;
}