Skip to content

Instantly share code, notes, and snippets.

@toritori0318
Created July 19, 2011 11:38
Show Gist options
  • Select an option

  • Save toritori0318/1092058 to your computer and use it in GitHub Desktop.

Select an option

Save toritori0318/1092058 to your computer and use it in GitHub Desktop.
遅延ロードを確認するのに lib/App/Web.pm へ記述する部分
# 初期ロードモジュール
my %init_module = ();
$init_module{$_}++ for keys %INC;
# getter
sub get_module {
return \%init_module;
}
# trigger
__PACKAGE__->add_trigger(
AFTER_DISPATCH => sub {
my ( $c, $res ) = @_;
my %init_module = %{$c->get_module};
my @required = grep { !$init_module{$_} } keys %INC;
warn "-------- module diff ---------";
warn join "\n", @required;
},
);
# load module....
#use DBI ();
#use DBD::mysql ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment