for($i = 0; $i < 10; $i++) { &foo(); } # foo: print the first three positive integers sub foo { for($i = 1; $i <= 3; $i++) { print $i; } print "\n"; }