我按照 CPAN 上的Rose::DB::Object 教程设置了三个包。
package My::DB::Object;
use My::DB;
use base qw(Rose::DB::Object);
sub init_db { My::DB->new }
package My::DB;
use base qw(Rose::DB);
...
package Motorcycle;
use base 'My::DB::Object';
__PACKAGE__->meta->setup
(
...
);
__PACKAGE__->meta->make_manager_class('motorcycles');
在应用程序中:
package main;
use Motorcycle;
use Mojolicious::Lite;
编译失败并出现此错误:
My/DB/Object did not return a true value <eval 2> line 2…
问候和感谢。