Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Just another Perl shrine
 
PerlMonks  

Re: Continuations in Perl - Returning to an arbitrary level up the call stack

by tobyink (Prior)
on May 18, 2013 at 20:54 UTC ( #1034151=note: print w/ replies, xml ) Need Help??


in reply to Continuations in Perl - Returning to an arbitrary level up the call stack

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


Comment on Re: Continuations in Perl - Returning to an arbitrary level up the call stack
Select or Download Code
Re^2: Continuations in Perl - Returning to an arbitrary level up the call stack
by unlinker (Monk) on May 18, 2013 at 21:30 UTC
    Thanks! Return::MultiLevel is exactly what I was looking for.
      > Thanks! Return::MultiLevel is exactly what I was looking for.

      Of course, it uses goto under the hood, just hidden behind massive abstraction and overhead ... 8-|

      Cheers Rolf

      ( addicted to the Perl Programming Language)

      ¹) Unfortunately there is no emoticon for shaking the head and sighing...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2013-05-18 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (396 votes), past polls