YahooMessenger/GoesOffline.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 32 CC 3 SCAR 18.4
CC
3
Cov
0%
source
12.0
from
2.0
to_string
2.0
CRAP 6.3
1 package Net::YahooMessenger::GoesOffline;
2 use base 'Net::YahooMessenger::Event';
3 use strict;
4  
5 sub source {
6 my $self = shift;
7 if (@_) {
8 $self->SUPER::source(@_);
9 my $yahoo = $self->get_connection;
10 my ($buddy) = grep { $_->name eq lc $self->from } $yahoo->buddy_list;
11 return unless $buddy;
12  
13 $buddy->online(undef);
14 }
15 $self->SUPER::source();
16 }
17  
18 sub from {
19 my $self = shift;
20 $self->_get_by_name('BUDDY_ID');
21 }
22  
23 sub to_string {
24 my $self = shift;
25 sprintf "%s: goes offline", $self->{sender};
26 }
27  
28 1;
29 __END__