Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Mojolicious hook

by Dumb (Initiate)
on Jun 05, 2019 at 11:41 UTC ( #11101003=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11101003]
Approved by haukex
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2021-11-27 02:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found