Archive::Zipと比較した利点
- インターフェースが実直
- 依存モジュールもさほど多くない
- ZIPアーカイブ以外にも.tar.gzあたりにも対応してくれる
- 安定と実績の作者
$ curl -L http://is.gd/plenvsetup | bash
$ curl -L http://is.gd/rbenvsetup | bash
minil new New::Module
minil build
minil test
minil release
minil migrate
Return::Value is deprecated
BEGIN {
$Return::Value::NO_CLUCK = 1;
}
use Email::Send;
[./bin/my_batch.pl] #!/usr/bin/env perl use strict; use warnings; use MyApp::Model::AnyWhere; printf "%s\n", MyApp::Model::AnyWhere->work;
[./lib/MyApp/Model/AnyWhere.pm]
package MyApp::Model::AnyWhere;
use strict;
use warnings;
use MyApp;
MyApp->bootstrap; ### これがだめ
sub c {
return MyApp->context;
}
sub work {
my ($class) = @_;
return c->config->{Foobar};
}
1;
[./bin/my_batch.pl] #!/usr/bin/env perl use strict; use warnings; use MyApp; use MyApp::Model::AnyWhere; MyApp->bootstrap; ### ここでbootstrapする printf "%s\n", MyApp::Model::AnyWhere->work;
[./lib/MyApp/Model/AnyWhere.pm]
package MyApp::Model::AnyWhere;
use strict;
use warnings;
use MyApp;
sub c {
return MyApp->context;
}
sub work {
my ($class) = @_;
return c->config->{Foobar};
}
1;
git clone git://github.com/ytnobody/App-Shiroh.git cd App-Shiroh cpanm ./
{
consumar_key => 'YOUR CONSUMER KEY',
consumer_secret => 'YOUR CONSUMER SECRET',
access_token => 'YOUR ACCESS TOKEN',
access_token_secret => 'YOUR ACCESS TOKEN SECRET',
message_to => 'some_nickname', ### 無くてもOK。このアカウントにDを送る。
};
shiroh '通知です'
cat /path/to/file | shiroh
sub hoge {
my $cb = shift;
my $caller = caller();
local *{$caller.'::foo'} = sub { .... };
$cb->();
}
hoge(sub{ foo() })