pmg has asked for the wisdom of the Perl Monks concerning the following question:

Scenario:

I am in the debugger in a subroutine.

I want to force an immediate return from that subroutine, without executing the rest of the subroutine.

<DB> a return

doesn't return.

Any suggestions?

Replies are listed 'Best First'.
Re: inserting code in the debugger
by jethro (Monsignor) on Jul 13, 2010 at 11:29 UTC

    Since the action is probably executed in an eval, return will only return from the eval. You might try goto instead.

    UPDATE: Tried it out, it works. Just enter 'goto label' (without a, you can enter perl commands directly in the debugger) and it works. Drawback, you need a label at the place you want to go to