NAME return::thence - return values from up above SYNOPSIS
"return" has a seemed inconsistency when used within functions
that take a code block, such as "try" below. use Try::Tiny; #
will return 1 sub foo { try { return(2) }; return 1; } This
module introduces a "return::thence" keyword which returns from
where you really mean: # will return 2 sub bar { try {
return::thence(2) }; return 1; } DESCRIPTION This module needs
to perform a bit of guesswork to figure out where you want to
return from. Looking at the call stack, it returns from the
first named function (see Sub::Name, Sub::Identify) that was
defined in the same file and same package as its immediate
caller. "return::thence" doesn't especially differentiate
between list and scalar context. sub baz { return::thence('a' ..
'z') }; my @baz = baz() # 'a' .. 'z' my $baz = baz(); # 'z' If
you need more power, use Scope::Upper which is what this module
uses under the hood. BUGS Please report any bugs to . SEE ALSO
Scope::Upper. AUTHOR Toby Inkster . COPYRIG