use strict; use warnings; { # closure my %foo; sub collect_it { my ($key, $value) = @_; $foo{$key} = $value; } sub print_it { for my $key ( keys %foo ) { print "\$foo{$key} = $foo{$key}\n"; } clear_it(); } sub clear_it { %foo = (); } } # end closure #### Variable "%foo" will not stay shared at 60oehl line 123.