Created
February 21, 2009 12:31
-
-
Save mash/68027 to your computer and use it in GitHub Desktop.
better load modules before forked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Catalyst::Plugin::DumpRequired; | |
use strict; | |
use warnings; | |
use NEXT; | |
our %initial_modules; | |
sub setup_actions { | |
my $c = shift; | |
$c->NEXT::setup_actions(@_); | |
$initial_modules{$_}++ for keys %INC; | |
$c->log->debug("[C::P::DumpRequired]initial_modules: \n".join("\n", keys %initial_modules)); | |
} | |
sub finalize { | |
my $c = shift; | |
$c->NEXT::finalize(@_); | |
my @required = sort grep { ! $initial_modules{$_} } keys %INC; | |
$c->log->debug("[C::P::DumpRequired]added_modules: \n".join("\n",@required)); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment