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 }) } #### goto &resolve_value(sub { ... });