in reply to Tweaking 'return'.

This kind of behavor is a feature of "Aspect Oriented Programming" or AOP for short. Check out Aspect for one approach to AOP in perl.

HTH, --traveler