line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Selector::XPath::Simple; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
55460
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
61
|
|
5
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
147
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1572
|
use version; our $VERSION = qv('0.0.3'); |
|
2
|
|
|
|
|
4543
|
|
|
2
|
|
|
|
|
15
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
2243
|
use HTML::Selector::XPath; |
|
2
|
|
|
|
|
11502
|
|
|
2
|
|
|
|
|
101
|
|
10
|
2
|
|
|
2
|
|
1887
|
use HTML::TreeBuilder::XPath; |
|
2
|
|
|
|
|
178479
|
|
|
2
|
|
|
|
|
43
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
1
|
|
|
1
|
1
|
15
|
my $class = shift; |
14
|
1
|
|
|
|
|
18
|
bless { |
15
|
|
|
|
|
|
|
tree => HTML::TreeBuilder::XPath->new->parse( shift )->eof, |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub select { |
20
|
5
|
|
|
5
|
1
|
4299
|
my $self = shift; |
21
|
5
|
|
|
|
|
34
|
my $xpath = HTML::Selector::XPath->new( shift )->to_xpath; |
22
|
5
|
|
|
|
|
931
|
my @results = map { @{ $_->content } } |
|
9
|
|
|
|
|
96840
|
|
|
9
|
|
|
|
|
37
|
|
23
|
|
|
|
|
|
|
$self->{tree}->findnodes($xpath); |
24
|
5
|
100
|
|
|
|
69
|
return wantarray ? @results : $results[0]; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
28
|
|
|
|
|
|
|
__END__ |