line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Mechanize::Link; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
131871
|
use strict; |
|
15
|
|
|
|
|
54
|
|
|
15
|
|
|
|
|
589
|
|
4
|
15
|
|
|
15
|
|
90
|
use warnings; |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
5779
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.16'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#ABSTRACT: Link object for WWW::Mechanize |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
199
|
|
|
199
|
1
|
1905
|
my $class = shift; |
13
|
|
|
|
|
|
|
|
14
|
199
|
|
|
|
|
270
|
my $self; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# The order of the first four must stay as they are for |
17
|
|
|
|
|
|
|
# compatibility with older code. |
18
|
199
|
100
|
|
|
|
461
|
if ( ref $_[0] eq 'HASH' ) { |
19
|
197
|
|
|
|
|
313
|
$self = [ @{$_[0]}{ qw( url text name tag base attrs ) } ]; |
|
197
|
|
|
|
|
699
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
else { |
22
|
2
|
|
|
|
|
12
|
$self = [ @_ ]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
199
|
|
|
|
|
676
|
return bless $self, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
317
|
|
|
317
|
1
|
21992
|
sub url { return ($_[0])->[0]; } |
30
|
411
|
|
|
411
|
1
|
2316
|
sub text { return ($_[0])->[1]; } |
31
|
34
|
|
|
34
|
1
|
215
|
sub name { return ($_[0])->[2]; } |
32
|
48
|
|
|
48
|
1
|
324
|
sub tag { return ($_[0])->[3]; } |
33
|
57
|
|
|
57
|
1
|
170
|
sub base { return ($_[0])->[4]; } |
34
|
28
|
|
|
28
|
1
|
222
|
sub attrs { return ($_[0])->[5]; } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub URI { |
38
|
55
|
|
|
55
|
1
|
685
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
55
|
|
|
|
|
1702
|
require URI::URL; |
41
|
55
|
|
|
|
|
20454
|
my $URI = URI::URL->new( $self->url, $self->base ); |
42
|
|
|
|
|
|
|
|
43
|
55
|
|
|
|
|
24376
|
return $URI; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub url_abs { |
48
|
53
|
|
|
53
|
1
|
2859
|
my $self = shift; |
49
|
|
|
|
|
|
|
|
50
|
53
|
|
|
|
|
100
|
return $self->URI->abs; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |