Using foreach loop to create a list of random number : rand « System Functions « Perl
- Perl
- System Functions
- rand
Using foreach loop to create a list of random number
print "Some lottery numbers to try:";
foreach (1 .. 6) {
print " " . int rand (50) + 1;
}
Related examples in the same category