in reply to Behaving appropriately based on ref() result

You might want to have a look at Contextual::Return
  • Comment on Re: Behaving appropriately based on ref() result