- 192 名前:nobodyさん mailto:sage [2011/10/08(土) 14:37:18.51 ID:???]
- https://github.com/motemen/WWW-BBS-2ch
の make test は Result: PASS になり、 SYNOPSIS にあるコードを動かしてみたところ、 Can't call method "add_handler" on an undefined value at /usr/lib/perl5/site_perl/5.10/WWW/BBS/2ch.pm line 39. と出ました。なので 2ch.pm:39 を見ると、 https://github.com/motemen/WWW-BBS-2ch/blob/master/lib/WWW/BBS/2ch.pm my $class = shift; my $self = bless { ua => LWP::UserAgent->new(agent => "Monazilla/1.00 WWW::BBS::2ch/$VERSION"), encoding => 'shift_jis', @_, }, $class; $self->ua->add_handler( という感じです。 Dumper $self->ua; すると undef です。 エディタを開いて試しに自分で $ua = LWP::UserAgent->new(agent => "Monazilla/1.00 WWW::BBS::2ch/$VERSION"); $ua->add_handler( とか書くと $ua は取得できて add_handler も動くので CPAN モジュールは問題なく入っているようです。 my $self = bless {} が怪しいのですが、どうすれば WWW::BBS::2ch の SYNOPSIS を動かせるでしょうか。
|

|