It just occurred to me that you could also use an auxilary subroutine that shares the same memory: ( my $private = undef; sub aSub { .... } sub aSubReset { $private = undef; } }