Addendum: I just realized that Perl's 'rand' function returns a real
(i.e. fractional) number, and obviously in this case you don't want
values like 1.897453. You can turn those into integers using 'int'.
Here's an example:
#!/usr/local/bin/perl -w
srand;
$firstnum = int(rand(4));
print "A random number between 0 and 3 is: $firstnum\n";
$secondnum = int(rand(4));
print "Another random number between 0 and 3 is: $secondnum\n";
Notice the call to srand to initialize the random number
generator.