line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Mechanize::Link; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
107587
|
use strict; |
|
15
|
|
|
|
|
46
|
|
|
15
|
|
|
|
|
439
|
|
4
|
15
|
|
|
15
|
|
72
|
use warnings; |
|
15
|
|
|
|
|
26
|
|
|
15
|
|
|
|
|
4840
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.17'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#ABSTRACT: Link object for WWW::Mechanize |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
199
|
|
|
199
|
1
|
1528
|
my $class = shift; |
13
|
|
|
|
|
|
|
|
14
|
199
|
|
|
|
|
227
|
my $self; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# The order of the first four must stay as they are for |
17
|
|
|
|
|
|
|
# compatibility with older code. |
18
|
199
|
100
|
|
|
|
375
|
if ( ref $_[0] eq 'HASH' ) { |
19
|
197
|
|
|
|
|
271
|
$self = [ @{ $_[0] }{qw( url text name tag base attrs )} ]; |
|
197
|
|
|
|
|
509
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
else { |
22
|
2
|
|
|
|
|
6
|
$self = [@_]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
199
|
|
|
|
|
544
|
return bless $self, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
317
|
|
|
317
|
1
|
14297
|
sub url { return ( $_[0] )->[0]; } |
30
|
411
|
|
|
411
|
1
|
1878
|
sub text { return ( $_[0] )->[1]; } |
31
|
34
|
|
|
34
|
1
|
161
|
sub name { return ( $_[0] )->[2]; } |
32
|
48
|
|
|
48
|
1
|
261
|
sub tag { return ( $_[0] )->[3]; } |
33
|
57
|
|
|
57
|
1
|
147
|
sub base { return ( $_[0] )->[4]; } |
34
|
28
|
|
|
28
|
1
|
166
|
sub attrs { return ( $_[0] )->[5]; } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub URI { |
38
|
55
|
|
|
55
|
1
|
536
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
55
|
|
|
|
|
1284
|
require URI::URL; |
41
|
55
|
|
|
|
|
15783
|
my $URI = URI::URL->new( $self->url, $self->base ); |
42
|
|
|
|
|
|
|
|
43
|
55
|
|
|
|
|
19618
|
return $URI; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub url_abs { |
48
|
53
|
|
|
53
|
1
|
2367
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
53
|
|
|
|
|
79
|
return $self->URI->abs; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |