line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::TokeParser::Simple::Token::Text; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
24
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
326
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '3.16'; |
6
|
5
|
|
|
5
|
|
39
|
use base 'HTML::TokeParser::Simple::Token'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
2202
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub as_is { |
9
|
48
|
|
|
48
|
1
|
165
|
return shift->[1]; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
1
|
520
|
sub is_text { 1 } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
1; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__END__ |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
HTML::TokeParser::Simple::Token::Text - Token.pm text class. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use HTML::TokeParser::Simple; |
25
|
|
|
|
|
|
|
my $p = HTML::TokeParser::Simple->new( $somefile ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
while ( my $token = $p->get_token ) { |
28
|
|
|
|
|
|
|
# This prints all text in an HTML doc (i.e., it strips the HTML) |
29
|
|
|
|
|
|
|
next unless $token->is_text; |
30
|
|
|
|
|
|
|
print $token->as_is; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This class represents "text" tokens. See the C<HTML::TokeParser::Simple> |
36
|
|
|
|
|
|
|
documentation for details. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 OVERRIDDEN METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=over 4 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item * as_is |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item * is_text |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |