#!/usr/bin/perl -w use strict; sub three { my $inside=1; my $four = sub { $inside++; my $inner=$inside+1; print "$inside $inner\n"; }; # notice the semicolon, this is a statement! print "$inside "; &$four(); &$four(); } three(); three(); ##### returns # 1 2 3 # 3 4 # 1 2 3 # 3 4