The Perl 5 module Contextual::Return provides a collection of named blocks that allow a return statement to return different values depending on the context in which it's called.