PR

[perl] モジュールの初期化

モジュールの初期化処理をするにはどうしたらよいのだろうか?


sub __new {
my $pkg = shift;
my $this = bless {} => $pkg;

$this->{INI} = undef; # Tripletail::Ini
$this->{filter} = {}; # 優先順位 => Tripletail::Filter
$this->{filterlist} = []; # [Tripletail::Filter, ...] 優先順位でソート済み

$this->{hook} = {
init        => {}, # 優先順位 => CODE
term        => {},
};
$this->{hooklist} = {
init        => [], # [CODE, ...] 優先順位でソート済み
term        => [],
};

$this;
}


コメント