# Let's do this up to 10 times, but only as long as we have URLs while ($count < 10 and @urls) { # Choose a random URL from the list, and remove it from the list my $url_index = int(@urls * rand); my $source = splice @urls, $url_index, 1; # continue normally getstore($source, "web/$count.html"); print URLMAP "$count\n$source\n"; $count++; }