SL4A に Mouse を入れる際の注意点
PurePerl でも動く Mouse であれば SL4A でも動くだろって軽く考えてたら少しはまったのでメモ。
1. MouseをAndroid端末に転送
adb push Mouse.pm /sdcard/com.googlecode.perlforandroid/extras/perl/site_perl adb push Mouse /sdcard/com.googlecode.perlforandroid/extras/perl/site_perl/Mouse/
2. Mouseを使用するスクリプトを準備
{ package Android::Role; use Android; use Mouse::Role; has android => ( is => 'ro', default => sub{ Android->new }, init_arg => undef, ); package Hello; use Mouse; with 'Android::Role'; has message => ( is => 'ro', default => 'World' ); sub say { my $self = shift; $self->android->makeToast('Hello, ' . $self->message); } __PACKAGE__->meta->make_immutable; } my $hello = Hello->new({ message => 'Mouse' }); $hello->say; __END__
adb push mouse.pl /sdcard/sl4a/scripts
実行・・・あれっ!?
Can't locate mro.pm in @INC (@INC containts: ...
mro.pmが無い・・・だと?