Catalystのモデルのモデルを外部スクリプトからいじる方法。 最新のDBIx::Class::Schema::Loader(0.03007)の場合。 そして、libディレクトリと同じ階層のディレクトリ内にスクリプトがある時。
#!/usr/bin/perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
{
package MyApp::Model::DBIC;
use base qw/DBIx::Class::Schema::Loader/;
__PACKAGE__->connection('dbi:SQLite:myapp.db');
__PACKAGE__->loader_options();
}
#これで以下のようにDBICのモデルが使える
my $rs = MyApp::Mode::DBIC->resultset("Hoge")->seach;

