#!/usr/bin/perl use MSN; use Jcode; my $msn = MSN->new(Handle => 'hoge@hotmail.com', Password => 'hogepass'); $msn->set_handler(Message => \&on_message); $msn->connect(); while(1) { $msn->do_one_loop(); } sub on_message { my ($self, $email, $name, $msg) = @_; my $utf8_name = Jcode->new($name, 'utf8')->euc; my $str = Jcode->new($msg, 'utf8')->euc; # $str を処理... my $utf8_str = Jcode->new($str, 'euc')->utf8; $self->sendmsg($utf8_str); }
# perl -MCPAN -e 'install Net::Msmgr'
- Net::MSN
Net-MSN
http://search.cpan.org/~djr/Net-MSN/
- Install
# perl -MCPAN -e 'install Hash::Merge'
# perl -MCPAN -e 'install Net::MSN'
- Reference
Bot-Depot
http://www.bot-depot.com/
cubic9.com - Linux/Perl/MSN.pm
http://cubic9.com/Devel/Perl/MSN.pm%20%28Bot-Depot%20realesed%29/