use strict;
use warnings;
-our $VERSION = '1.000017';
+our $VERSION = '1.000019';
$VERSION = eval $VERSION;
use Carp qw/croak/;
$VARNAME_REGEXP # without parens
)
\s*
- =[^=~] # = but not ==, nor =~
+ =[^=~>] # = but not ==, nor =~, nor =>
}x;
sub new_from_file {
#; package Module::Metadata::_version::p$pn;
use version;
no strict;
+ no warnings;
\$vsub = sub {
local $sigil$var;
}
}
+sub is_indexable {
+ my ($self, $package) = @_;
+
+ my @indexable_packages = grep { $_ ne 'main' } $self->packages_inside;
+
+ # check for specific package, if provided
+ return !! grep { $_ eq $package } @indexable_packages if $package;
+
+ # otherwise, check for any indexable packages at all
+ return !! @indexable_packages;
+}
+
1;
=head1 NAME
=item C<< name() >>
Returns the name of the package represented by this module. If there
-are more than one packages, it makes a best guess based on the
+is more than one package, it makes a best guess based on the
filename. If it's a script (i.e. not a *.pm) the package name is
'main'.
Returns the POD data in the given section.
+=item C<< is_indexable($package) >> or C<< is_indexable() >>
+
+Returns a boolean indicating whether the package (if provided) or any package
+(otherwise) is eligible for indexing by PAUSE, the Perl Authors Upload Server.
+Note This only checks for valid C<package> declarations, and does not take any
+ownership information into account.
+
=back
=head1 AUTHOR