/usr/share/perl5/HTML/TokeParser/Simple/Token/Tag.pm is in libhtml-tokeparser-simple-perl 3.16-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | package HTML::TokeParser::Simple::Token::Tag;
use strict;
our $VERSION = '3.16';
use base 'HTML::TokeParser::Simple::Token';
my %INSTANCE;
sub new {
my ($class, $object) = @_;
$class->_croak("This is a base class that should not be instantiated")
if __PACKAGE__ eq $class;
my $self = bless $object, $class;
$self->_init;
}
sub _get_attrseq { return [] }
sub _get_attr { return {} }
sub _set_text {
my $self = shift;
$self->[-1] = shift;
return $self;
}
# attribute munging methods
# get_foo methods
sub return_text {
carp('return_text() is deprecated. Use as_is() instead');
goto &as_is;
}
sub as_is {
return shift->_get_text;
}
sub get_tag {
return shift->_get_tag;
}
1;
__END__
=head1 NAME
HTML::TokeParser::Simple::Token::Tag - Token.pm tag class.
=head1 SYNOPSIS
use HTML::TokeParser::Simple;
my $p = HTML::TokeParser::Simple->new( $somefile );
while ( my $token = $p->get_token ) {
# This prints all text in an HTML doc (i.e., it strips the HTML)
next unless $token->is_text;
print $token->as_is;
}
=head1 DESCRIPTION
This is the base class for start and end tokens. It should not be
instantiated. See C<HTML::TokeParser::Simple::Token::Tag::Start> and
C<HTML::TokeParser::Simple::Token::Tag::End> for details.
=head1 OVERRIDDEN METHODS
The following list of methods are provided by this class. See
L<HTML::TokeParser::Simple> for descriptions of these methods.
=over 4
=item * as_is
=item * get_tag
=item * return_text
=back
|