use strict; use warnings; use 5.010; sub routine { my %hash; BEGIN { $hash{KEY} = "string"; } $hash{FOO} = "something else"; say join " ", keys %hash; } routine; routine; routine; __END__ Variable "%hash" will not stay shared at /tmp/hh line 12. KEY FOO FOO FOO