in reply to calling subroutines
The rand function (see perldoc -f rand) will help you with your first requirement--I'd suggest reading the entire perlfunc documentation to familiarize yourself with what's already done for you.
For your second requirement, read perldoc perlsyn paying special attention to the while and for loop constructs.
Update: It seems that the links are broken or the web server is having a bit of trouble. I'll review them a bit later and fix 'em if required.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|