#!/usr/bin/perl -w use strict; { my $closure; sub func_w_closure { print "Closure! ", $closure++, "\n"; func_w_closure($_[0]+1) if $_[0] < 3; } } sub func_w_static { my $static if 0; print "Static! ", $static++, "\n"; func_w_static($_[0]+1) if $_[0] < 3; } func_w_closure(0); func_w_static(0);