Skip to content

Instantly share code, notes, and snippets.

@mash
Created February 21, 2009 12:31
Show Gist options
  • Save mash/68027 to your computer and use it in GitHub Desktop.
Save mash/68027 to your computer and use it in GitHub Desktop.
better load modules before forked
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