D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
share
/
perl5
/
vendor_perl
/
Module
/
Build
/
Filename :
PodParser.pm
back
Copy
package Module::Build::PodParser; use strict; use warnings; our $VERSION = '0.4224'; $VERSION = eval $VERSION; sub new { # Perl is so fun. my $package = shift; my $self; $self = bless {have_pod_parser => 0, @_}, $package; unless ($self->{fh}) { die "No 'file' or 'fh' parameter given" unless $self->{file}; open($self->{fh}, '<', $self->{file}) or die "Couldn't open $self->{file}: $!"; } return $self; } sub parse_from_filehandle { my ($self, $fh) = @_; local $_; while (<$fh>) { next unless /^=(?!cut)/ .. /^=cut/; # in POD # Accept Name - abstract or C<Name> - abstract last if ($self->{abstract}) = /^ (?: [a-z_0-9:]+ | [BCIF] < [a-z_0-9:]+ > ) \s+ - \s+ (.*\S) /ix; } my @author; while (<$fh>) { next unless /^=head1\s+AUTHORS?/i ... /^=/; next if /^=/; push @author, $_ if /\@/; } return unless @author; s/^\s+|\s+$//g foreach @author; $self->{author} = \@author; return; } sub get_abstract { my $self = shift; return $self->{abstract} if defined $self->{abstract}; $self->parse_from_filehandle($self->{fh}); return $self->{abstract}; } sub get_author { my $self = shift; return $self->{author} if defined $self->{author}; $self->parse_from_filehandle($self->{fh}); return $self->{author} || []; }
Name
Size
Last Modified
Owner
Permissions
Actions
Platform
Dir
July 28 2023 2:59:02
root
0755
API.pod
67.087
KB
October 13 2019 10:59:01
root
0644
Authoring.pod
10.746
KB
October 13 2019 10:59:01
root
0644
Base.pm
161.332
KB
October 13 2019 10:59:01
root
0644
Bundling.pod
4.988
KB
October 13 2019 10:59:01
root
0644
Compat.pm
18.104
KB
October 13 2019 10:59:01
root
0644
Config.pm
1.076
KB
October 13 2019 10:59:01
root
0644
ConfigData.pm
6.682
KB
October 13 2019 10:59:01
root
0644
Cookbook.pm
16.931
KB
October 13 2019 10:59:01
root
0644
Dumper.pm
0.443
KB
October 13 2019 10:59:01
root
0644
Notes.pm
8.117
KB
October 13 2019 10:59:01
root
0644
PPMMaker.pm
4.432
KB
October 13 2019 10:59:01
root
0644
PodParser.pm
1.274
KB
October 13 2019 10:59:01
root
0644
2017 © D7net | D704T team