MeCabのインストール $ sudo aptitude install mecab libmecab-dev $ su - # cpan cpan>install Text::MeCab t/04-dclone....................1/? Can't call method "surface" on an undefined value at t/04-dclone.t line 22. うーん。とりあえずforce。 cpan>force install Text::MeCab インストール完了。 Twitterのfriends_timelineをGETして、Mecabで分解。 #!/usr/bin/perl use strict; use Net::Twitter; use Jcode; use Text::MeCab; my $twit = Net::Twitter->new(username=>"USERNAME", password=>"PASSWORD") ; my $result = $twit->friends_timeline(); my $i = 0; my $j = 0; my @DATA = (); my @words = (); foreach my $hash (@$result) { $DATA[$i] = $hash->{'text'}; $i++; } for ($j=0; $j my $mec = Text::MeCab->new; for (my $nod = $mec->parse($DATA[$j]); $nod; $nod=$nod->next ) { push @words, $nod->surface if length $nod->surface; } } print join ' ', @words; exit;