use strict; use warnings; sub counter { my ($n) = @_; print "N is $n\n"; if ($n > 0) { counter($n - 1); } print "N is $n\n"; } counter(4);