in reply to Re^2: Just before subroutine returns
in thread Just before subroutine returns

If you need to know which return returned, you might be able to wrap return using Keyword::Declare or Filter::Simple.

Be warned: These are very powerful, therefore dangerous to use.

Replies are listed 'Best First'.
Re^4: Just before subroutine returns
by LanX (Saint) on Aug 30, 2017 at 00:12 UTC
    I'd recommend Keyword::Simple , but for completeness: a sub can be left without return.

    Possibilities include:

    • implicit return at body's end
    • goto label in caller chain
    • goto &sub
    • die exception

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      This is true, of course. So, would still need something like End to catch those cases. (Though the implicit return at the body's end could be "hand modified".)