|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Continuations in Perl - Returning to an arbitrary level up the call stackby tobyink (Prior) |
| on May 18, 2013 at 20:54 UTC ( #1034151=note: print w/ replies, xml ) | Need Help?? |
|
There's Scope::Upper which provides unwind_at that essentially allows you to perform a return higher up the stack. You could also try Return::MultiLevel which seems to provide a pretty sane interface for continuations, albeit requiring some co-operation between caller and callee. Also take a look at some of MAUKE's other modules that follow on from that.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||