Task

Write a procedure which accepts as arguments another procedure and a positive integer.

The latter procedure is executed a number of times equal to the accepted integer.




sub repeat (&f, $n) { f() xx $n };
 
sub example { say rand }
 
repeat(&example, 3);