You can use a for loop to loop for a specific number of times.
#for (initialization; expression; continue) { # # ... #} #!/usr/bin/perl -w for ($i = 0; $i < 10; $i++) { print "Iteration $i.\n"; }