Server IP : 101.255.104.117 / Your IP : 101.255.104.117 Web Server : Apache/2.4.34 (Win32) OpenSSL/1.0.2o PHP/5.6.38 System : Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586 User : user ( 0) PHP Version : 5.6.38 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp182/perl/lib/Module/Build/ |
Upload File : |
package Module::Build::PodParser; use strict; use vars qw($VERSION); $VERSION = '0.4003'; $VERSION = eval $VERSION; use vars qw(@ISA); sub new { # Perl is so fun. my $package = shift; my $self; @ISA = (); $self = bless {have_pod_parser => 0, @_}, $package; unless ($self->{fh}) { die "No 'file' or 'fh' parameter given" unless $self->{file}; $self->{fh} = IO::File->new($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-z0-9:]+ | [BCIF] < [a-z0-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} || []; }