my $r = { subref => sub { return 2 * $_[0] } }; my $tied; tie $tied, 'TieTest', $r; # This will perform the pre-action before executing print $tied->(5); # These will not for(0..100){ print $tied->(5), "\n"; } package TieTest; sub TIESCALAR{ my $caller = shift; my $r = shift; bless $r, $caller; } sub FETCH{ my $r = shift; print "Checking for pause...\n"; return $$r{subref}; } #### # This will perform the pre-action before executing print $tied; # These will not for(0..10){ print $tied, "\n"; }