in reply to how to write a modified return() call?

That might be a bit overkill for your situation, but you could solve your problem with continuation passing, something along these lines:
sub resolve_value { my $start_with = another_value(); unless $start_with { warn "Could not get another value"; return; } my $continuation = shift; return $continuation->($start_with, @_); } # and here's how you use that code: sub foo { # do some work here resolve_value(sub { my $start_with = shift; # do the rest of the work here }) }

If you care about performance you could also tail-call into the sub:

goto &resolve_value(sub { ... });

Replies are listed 'Best First'.
Re^2: how to write a modified return() call?
by j1n3l0 (Friar) on Jul 15, 2009 at 10:52 UTC
    I think you've been spending too much time in Rakudo moritz ;)

    unless $start_with { ... } # missing "()" around $start_with


    Smoothie, smoothie, hundre prosent naturlig!