# Persistant subroutine data sub somesub { my $p_args = attached(\&somesub,'somesub') || attach_var(\&somesub,{called=>0},'somesub'); ++$p_args->{called}; # The persistant arg hash could be keyed on the caller info if desired # for context sensitivity }