line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AnyEvent::Finger::Request; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
56819
|
use strict; |
|
6
|
|
|
|
|
17
|
|
|
6
|
|
|
|
|
156
|
|
4
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
343
|
|
5
|
|
|
|
|
|
|
use overload |
6
|
12
|
|
|
12
|
|
61
|
'""' => sub { shift->as_string }, |
7
|
6
|
|
|
6
|
|
4059
|
bool => sub { 1 }, fallback => 1; |
|
6
|
|
|
0
|
|
3220
|
|
|
6
|
|
|
|
|
53
|
|
|
0
|
|
|
|
|
0
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Simple asynchronous finger request |
10
|
|
|
|
|
|
|
our $VERSION = '0.14'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
28
|
|
|
28
|
1
|
19083
|
bless { raw => "$_[1]" }, $_[0]; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub verbose |
20
|
|
|
|
|
|
|
{ |
21
|
18
|
|
|
18
|
1
|
2654
|
my($self) = @_; |
22
|
18
|
50
|
|
|
|
131
|
defined $self->{verbose} ? $self->{verbose} : $self->{verbose} = ($self->{raw} =~ /^\/W/ ? 1 : 0); |
|
|
100
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub username |
27
|
|
|
|
|
|
|
{ |
28
|
39
|
|
|
39
|
1
|
88
|
my($self) = @_; |
29
|
|
|
|
|
|
|
|
30
|
39
|
100
|
|
|
|
97
|
unless(defined $self->{username}) |
31
|
|
|
|
|
|
|
{ |
32
|
22
|
50
|
|
|
|
99
|
if($self->{raw} =~ /^(?:\/W\s*)?([^@]*)/) |
33
|
22
|
|
|
|
|
62
|
{ $self->{username} = $1 } |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
39
|
|
|
|
|
108
|
$self->{username}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub hostnames |
41
|
|
|
|
|
|
|
{ |
42
|
54
|
|
|
54
|
1
|
77
|
my($self) = @_; |
43
|
54
|
100
|
|
|
|
205
|
return $self->{hostnames} if defined $self->{hostnames}; |
44
|
28
|
100
|
|
|
|
263
|
$self->{hostnames} = ($self->{raw} =~ /\@(.*)$/ ? [split /\@/, $1] : []); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub as_string |
49
|
|
|
|
|
|
|
{ |
50
|
12
|
|
|
12
|
1
|
19
|
my($self) = @_; |
51
|
12
|
|
|
|
|
29
|
join('@', ($self->username, @{ $self->hostnames })); |
|
12
|
|
|
|
|
23
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
8
|
100
|
|
8
|
1
|
18
|
sub listing_request { shift->username eq '' ? 1 : 0 } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
23
|
100
|
|
23
|
1
|
36
|
sub forward_request { @{ shift->hostnames } > 0 ? 1 : 0} |
|
23
|
|
|
|
|
45
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |