sub outer { my $x; $x=shift; sub inner { print "x is $x\n"; } } #### package Node; use Cache; my $cache=new Cache; sub new { ## blah blah $self; } sub get { my $self=shift; my $id=shift; if (my $data=$cache->check($id)) { return $data; } ## blah blah } 1; #### { $cache=new Cache; } ## everything { undef $cache; }