すぐ忘れるし、どこにあったか分からなくなるのでメモ。
Selec All Code:
package MyApp; use Mojo::Base 'Mojolicious'; use DBIx::Custom; has dbi => sub { my $dbi = DBIx::Custom->connect(...); return $dbi; }; sub startup { my $self = shift; ### YOU MUST NOT CALL dbi() method in starup(). }
リンク先にはBad Exampleもあるので参考に。
カテゴリー: Mojolicious, perlモジュール - Trackback Uri

