/usr/share/perl5/Pod/Index/Entry.pm is in libpod-index-perl 0.14-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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | package Pod::Index::Entry;
use 5.008;
$VERSION = '0.14';
use strict;
use warnings;
use Pod::Index::Extract;
sub new {
my ($class, %args) = @_;
my $self = bless {
%args,
}, $class;
return $self;
}
sub podname { shift->{podname} }
sub line { shift->{line} }
sub filename { shift->{filename} }
sub context { shift->{context} }
sub keyword { shift->{keyword} }
sub pod {
my ($self) = @_;
return $self->{pod} if defined $self->{pod};
my $filename = $self->filename;
open my $in, "<", $filename or die "couldn't open $filename $!\n";
open my $out, ">", \(my $pod) or die "couldn't open output fh: $!\n";
my $parser = Pod::Index::Extract->new(
ppi_entry => $self,
);
<$in> for (1 .. $self->{line} - 1); # skip lines
$parser->parse_from_filehandle($in, $out);
return $self->{pod} = $pod;
}
1;
=head1 NAME
Pod::Index::Entry - Represents Pod search result
=head1 SYNOPSIS
use Pod::Index::Entry;
my $entry = Pod::Index::Entry->new(
keyword => 'constructors',
podname => 'perlobj',
line => 42,
filename => '/usr/lib/perl5/5.8.7/pod/perlobj.pod',
context => 'Using POD',
);
# trivial accessors
my $podname = $entry->podname;
my $filename = $entry->filename;
my $line = $entry->line;
my $context = $entry->context;
my $keyword = $entry->keyword;
# extract the POD for this entry
my $pod = $entry->pod;
=head1 DESCRIPTION
This class represents a POD index entry. An entry is defined by the
podname/filename, line number, and context. The entry object also has the
ability to extract the POD "scope" from the filename.
=head1 METHODS
=over
=item new
my $q = Pod::Index::Entry->new(%args);
Create a new search object. Possible arguments are:
=over
=item podname
The name of the pod, such as X<Data::Dumper>.
=item filename
The filename for the pod, such as F<Data/Dumper.pm>.
=item line
The line number where the scope of this entry begins.
=item context
The title of the section that contains this entry.
=back
=item podname
=item filename
=item line
=item context
These are just simple accessors that return the value of these properties,
as given to the constructor.
=item pod
Extracts the POD for the scope of the entry from $self->filename, beginning at
$self->line. For a definition of I<scope>, see L<Pod::Index>. The POD
extraction is delegated to the L<Pod::Index::Extract> module.
=back
=head1 VERSION
0.14
=head1 SEE ALSO
L<Pod::Index>,
L<Pod::Index::Search>,
L<Pod::Index::Extract>
=head1 AUTHOR
Ivan Tubert-Brohman E<lt>itub@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright (c) 2005 Ivan Tubert-Brohman. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms as
Perl itself.
=cut
|