sub foo { my $i = shift; return if $i <= 0; sub printFoo { print "The \$i=$i\n"; } printFoo(); foo($i-1); }