use strict; use warnings; use 5.010; my @return_stack; sub RETURN { push @return_stack, [@_]; no warnings 'exiting'; last 'UNIQUELABEL'; } sub menu { UNIQUELABEL: while (1) { for (@_) { $_->(); } } return @{pop @return_stack}; }; say menu sub { say 'go on' }, sub { RETURN menu sub { say 'still here' }, sub { RETURN 'ended' }, sub { 'never called' }, }, sub { 'never called' }, ; __END__ go on still here ended