Perlでtwitterに何かをやらかすにはNet::Twitterというモジュールを利用するといいようです。
早速Net::Twitterを入れてみることにしました。
ちなみに、WindowsVistaはActivePerl 5.8.8です。
ppmでは用意されていないので、CPANからインストールします。
しかし、実際に実行してみると、いろいろ足らないからインストールしますよといわれて、言うとおりにインストールしたのですが、あちこちでNOT OKとなってしまいます。
C:\Users\admin>cpan install Net::Twitter CPAN: Storable loaded ok Going to read C:\Perl\cpan\Metadata Database was generated on Thu, 22 Apr 2010 21:26:57 GMT install is up to date. Running install for module Net::Twitter Running make for M/MM/MMIMS/Net-Twitter-3.12000.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for C:\Perl\cpan\sources\authors\id\M\MM\MMIMS\Net-Twitter-3.12000.tar.gz ok Scanning cache C:\Perl/cpan/build for sizes Deleting from cache: C:\Perl\cpan\build\ExtUtils-MakeMaker-6.56 (17.6>10.0 MB) Can't remove directory C:\Perl\cpan\build\ExtUtils-MakeMaker-6.56/t/Big-Dummy (Permission denied) at C:/Perl/lib/CPAN.pm line 9 6 Can't remove directory C:\Perl\cpan\build\ExtUtils-MakeMaker-6.56/t (Directory not empty) at C:/Perl/lib/CPAN.pm line 966 Can't remove directory C:\Perl\cpan\build\ExtUtils-MakeMaker-6.56 (Directory not empty) at C:/Perl/lib/CPAN.pm line 966 Deleting from cache: C:\Perl\cpan\build\Net-Twitter-3.12000 (17.6>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Sub-Name-0.04 (17.0>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Sub-Identify-0.04 (16.9>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Variable-Magic-0.41 (16.7>10.0 MB) Deleting from cache: C:\Perl\cpan\build\B-Hooks-EndOfScope-0.08 (16.5>10.0 MB) Deleting from cache: C:\Perl\cpan\build\namespace-clean-0.14 (16.4>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Scalar-List-Utils-1.23 (16.3>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Devel-GlobalDestruction-0.02 (16.2>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Class-MOP-1.00 (16.0>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Moose-1.01 (15.0>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Data-Visitor-0.27 (12.5>10.0 MB) Deleting from cache: C:\Perl\cpan\build\DateTime-0.55 (12.4>10.0 MB) Deleting from cache: C:\Perl\cpan\build\DateTime-Format-Strptime-1.2000 (11.6>10.0 MB) Deleting from cache: C:\Perl\cpan\build\MooseX-MultiInitArg-0.01 (11.4>10.0 MB) Deleting from cache: C:\Perl\cpan\build\namespace-autoclean-0.09 (11.4>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Digest-SHA1-2.12 (11.3>10.0 MB) Deleting from cache: C:\Perl\cpan\build\Encode-2.39 (11.2>10.0 MB) CPAN: Archive::Tar loaded ok Net-Twitter-3.12000/ Net-Twitter-3.12000/lib/ Net-Twitter-3.12000/lib/Net/ Net-Twitter-3.12000/lib/Net/Identica.pm Net-Twitter-3.12000/lib/Net/Twitter.pm Net-Twitter-3.12000/lib/Net/Twitter/ Net-Twitter-3.12000/lib/Net/Twitter/Role/ Net-Twitter-3.12000/lib/Net/Twitter/Role/WrapError.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/Legacy.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/API/ Net-Twitter-3.12000/lib/Net/Twitter/Role/API/Search.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/API/TwitterVision.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/API/REST.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/API/Lists.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/OAuth.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/RetryOnError.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/RateLimit.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/SimulateCursors.pm Net-Twitter-3.12000/lib/Net/Twitter/Role/InflateObjects.pm Net-Twitter-3.12000/lib/Net/Twitter/OAuth/ Net-Twitter-3.12000/lib/Net/Twitter/OAuth/XAuthRequest.pm Net-Twitter-3.12000/lib/Net/Twitter/API.pm Net-Twitter-3.12000/lib/Net/Twitter/Search.pm Net-Twitter-3.12000/lib/Net/Twitter/Core.pm Net-Twitter-3.12000/lib/Net/Twitter/OAuth.pm Net-Twitter-3.12000/lib/Net/Twitter/Error.pm Net-Twitter-3.12000/lib/Net/Twitter.pod Net-Twitter-3.12000/Changes Net-Twitter-3.12000/MANIFEST Net-Twitter-3.12000/examples/ Net-Twitter-3.12000/examples/oauth_webapp.pl Net-Twitter-3.12000/examples/oauth_desktop.pl Net-Twitter-3.12000/README Net-Twitter-3.12000/src/ Net-Twitter-3.12000/src/net-twitter-pod.tt2 Net-Twitter-3.12000/src/build.pl Net-Twitter-3.12000/t/ Net-Twitter-3.12000/t/22_twitter_insanity.t Net-Twitter-3.12000/t/20_exceptions.t Net-Twitter-3.12000/t/unicode.t Net-Twitter-3.12000/t/lib/ Net-Twitter-3.12000/t/lib/TestUA.pm Net-Twitter-3.12000/t/13_search.t Net-Twitter-3.12000/t/99-pod_syntax.t Net-Twitter-3.12000/t/02_fails.t Net-Twitter-3.12000/t/51_rate_limit.t Net-Twitter-3.12000/t/40_nt_subclasses.t Net-Twitter-3.12000/t/11_useragent.t Net-Twitter-3.12000/t/50_inflate_objects.t Net-Twitter-3.12000/t/99-pod_coverage.t Net-Twitter-3.12000/t/21_wraperror.t Net-Twitter-3.12000/t/10_net-twitter-regression.t Net-Twitter-3.12000/t/12_identica.t Net-Twitter-3.12000/t/01_basic.t Net-Twitter-3.12000/t/60-api_lists.t Net-Twitter-3.12000/t/retry.t Net-Twitter-3.12000/t/geo.t Net-Twitter-3.12000/t/51_since.t Net-Twitter-3.12000/t/00_load.t Net-Twitter-3.12000/t/14_authenticate.t Net-Twitter-3.12000/t/30_legacy.t Net-Twitter-3.12000/t/20_generated.t Net-Twitter-3.12000/t/15_subclass.t Net-Twitter-3.12000/t/99-pod_spelling.t Net-Twitter-3.12000/t/lookup_users.t Net-Twitter-3.12000/META.yml Net-Twitter-3.12000/Makefile.PL Net-Twitter-3.12000/inc/ Net-Twitter-3.12000/inc/Module/ Net-Twitter-3.12000/inc/Module/Install.pm Net-Twitter-3.12000/inc/Module/Install/ Net-Twitter-3.12000/inc/Module/Install/WriteAll.pm Net-Twitter-3.12000/inc/Module/Install/Fetch.pm Net-Twitter-3.12000/inc/Module/Install/Win32.pm Net-Twitter-3.12000/inc/Module/Install/Include.pm Net-Twitter-3.12000/inc/Module/Install/Repository.pm Net-Twitter-3.12000/inc/Module/Install/AutoInstall.pm Net-Twitter-3.12000/inc/Module/Install/Base.pm Net-Twitter-3.12000/inc/Module/Install/Metadata.pm Net-Twitter-3.12000/inc/Module/Install/Can.pm Net-Twitter-3.12000/inc/Module/Install/Makefile.pm Net-Twitter-3.12000/inc/Module/Install/AutoManifest.pm Net-Twitter-3.12000/inc/Module/AutoInstall.pm CPAN.pm: Going to build M/MM/MMIMS/Net-Twitter-3.12000.tar.gz *** Module::AutoInstall version 1.03 *** Checking for Perl dependencies... [Core Features] - Test::More ...loaded. (0.94 >= 0.88) - Carp ...loaded. (1.04) - Digest::SHA ...loaded. (5.47) - List::Util ...loaded. (1.18) - Net::Netrc ...loaded. (2.12) - Scalar::Util ...loaded. (1.18) - Data::Visitor::Callback ...missing. - DateTime ...missing. (would need 0.51) - DateTime::Format::Strptime ...missing. (would need 1.09) - Encode ...loaded. (2.12) - HTML::Entities ...loaded. (1.35) - HTTP::Request::Common ...loaded. (1.26) - JSON::Any ...loaded. (1.22 >= 1.21) - LWP::UserAgent ...loaded. (2.033 >= 2.032) - Moose ...missing. (would need 0.9) - Moose::Exporter ...missing. - Moose::Role ...missing. - MooseX::MultiInitArg ...missing. - namespace::autoclean ...missing. (would need 0.09) - Net::OAuth ...missing. (would need 0.2) - URI ...loaded. (1.52 >= 1.4) - URI::Escape ...loaded. (3.29) - Try::Tiny ...loaded. (0.04) - JSON ...loaded. (2.17 >= 2.02) ==> Auto-install the 9 mandatory module(s) from CPAN? [y]
とりあえずそのままYを押して足らないものを入れさせてみましたが、ぜんぜんだめでした。
ちなみに、CentOS5のPerl5.8.8でも同じような現象に。CPAN自体をアップデートしてやり直してもだめ。yumから1つ1つ入れてみようと思って、まず
yum install perl-Moose
を終えても、CPANからはまた入れなおそうとしてしまいます。
Mooseという新しい技術を利用するのもいいのですが、入れること自体がハードルが高いとあまり意味がないですね。別のOSで試すとか、あきらめるしかないのかなぁ。がっかり。