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

Can some please explain me Mojolicious hook and how I can use it in my script. The requirement is to call another subroutine after the return statement of the existing subroutine. I know, we cannot call anything after the return. But I want a way to do it. Thanks a lot for the help

Replies are listed 'Best First'.
Re: Mojolicious hook
by trippledubs (Deacon) on Jun 05, 2019 at 13:01 UTC
Re: Mojolicious hook
by daxim (Curate) on Jun 05, 2019 at 14:27 UTC
Re: Mojolicious hook
by Laurent_R (Canon) on Jun 05, 2019 at 20:49 UTC
    Sure, you can put calls to subroutines after the return statement of a sub, but the problem is that such subroutines call will never be reached in the control flow of the program (at least if it is an unconditional return statement). Those subroutine calls are just dead code for all practical purposes.