Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2021-12-09 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?