Server IP : 173.249.157.85 / Your IP : 3.133.160.6 Web Server : Apache System : Linux server.frogzhost.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : econtech ( 1005) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/perl5/Module/Build/
Current File : /usr/local/share/perl5/Module/Build/PodParser.pm
package Module::Build::PodParser;
use strict;
use warnings;
our $VERSION = '0.4231';
$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} || [];
}