http://www.perlmonks.org?node_id=11125631

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

I'm trying to use the same hooks in two Dancer2 apps (I need two apps because of serialization limitations in Dancer2). So, I have the 'hook' calls in a third module. The problem is that the hooks don't seem to get registered in the apps.
package A; use Dancer2 appname => 'A'; use MyHook; ... package B; use Dancer2 appname => 'B'; use MyHook; ... package MyHook; use Dancer2; hook before => sub { print "hello\n"; };
If I append an appname => 'A' to the use Dancer2 directive in MyHook, I can get the hooks registered in app A, and likewise with app B, but I'd like to find a way to get the hooks registered in both apps.

Thoughts?