Lines Matching full:package

3 package Module::Metadata; # git description: v1.000037-8-g92dec6c
4 # ABSTRACT: Gather package and POD information from perl module files
43 my $PKG_FIRST_WORD_REGEXP = qr{ # the FIRST word in a package name
51 my $PKG_ADDL_WORD_REGEXP = qr{ # the 2nd+ word in a package name
59 my $PKG_NAME_REGEXP = qr{ # match a package name
61 $PKG_FIRST_WORD_REGEXP # a package word
64 $PKG_ADDL_WORD_REGEXP ### a package word
71 my $PKG_REGEXP = qr{ # match a package declaration
73 package # the word 'package'
75 ($PKG_NAME_REGEXP) # a package name
86 ($PKG_NAME_REGEXP) # a package name
96 ( # optional leading package name
280 foreach my $package ( $pm_info->packages_inside ) {
281 next if $package eq 'main'; # main can appear numerous times, ignore
282 next if $package eq 'DB'; # special debugging package, ignore
283 next if grep /^_/, split( /::/, $package ); # private package, ignore
285 my $version = $pm_info->version( $package );
287 $prime_package = $package if lc($prime_package) eq lc($package);
288 if ( $package eq $prime_package ) {
289 if ( exists( $prime{$package} ) ) {
290 croak "Unexpected conflict in '$package'; multiple versions found.\n";
293 $mapped_filename = "$package.pm" if lc("$package.pm") eq lc($mapped_filename);
294 $prime{$package}{file} = $mapped_filename;
295 $prime{$package}{version} = $version if defined( $version );
299 push( @{$alt{$package}}, {
309 # for each package.
310 foreach my $package ( keys( %alt ) ) {
311 my $result = $resolve_module_versions->( $alt{$package} );
313 if ( exists( $prime{$package} ) ) { # primary package selected
316 # Use the selected primary package, but there are conflicting
320 "Found conflicting versions for package '$package'\n" .
321 " $prime{$package}{file} ($prime{$package}{version})\n" .
327 # There is a primary package selected, and exactly one
328 # alternative package
330 if ( exists( $prime{$package}{version} ) &&
331 defined( $prime{$package}{version} ) ) {
332 # Unless the version of the primary package agrees with the
333 # version of the alternative package, report a conflict
335 $prime{$package}{version}, '!=', $result->{version}
340 "Found conflicting versions for package '$package'\n" .
341 " $prime{$package}{file} ($prime{$package}{version})\n" .
348 # The prime package selected has no version so, we choose to
349 # use any alternative package that does have a version
350 $prime{$package}{file} = $result->{file};
351 $prime{$package}{version} = $result->{version};
356 # no alt package found with a version, but we have a prime
357 # package so we use it whether it has a version or not
361 else { # No primary package was selected, use the best alternative
365 "Found conflicting versions for package '$package'\n" .
372 $prime{$package}{file} = $result->{file};
373 $prime{$package}{version} = $result->{version}
460 my $module = shift || croak 'find_module_by_name() requires a package name';
490 # $VERSION assignment, returning sigil, full name, & package name
495 my( $sigil, $variable_name, $package);
497 ( $sigil, $variable_name, $package) = $2 ? ( $1, $2, $3 ) : ( $4, $5, $6 );
498 if ( $package ) {
499 $package = ($package eq '::') ? 'main' : $package;
500 $package =~ s/::$//;
504 return ( $sigil, $variable_name, $package );
552 my $package = 'main';
622 $package = $1;
624 push( @packages, $package ) unless grep( $package eq $_, @packages );
627 if ( not exists $vers{$package} and defined $version ){
632 $vers{$package} = $dwim_version;
636 # VERSION defined with full package spec, i.e. $Module::VERSION
638 # we do NOT save this package in found @packages
639 $need_vers = 0 if $version_package eq $package;
646 # first non-comment line in undeclared package main is VERSION
647 elsif ( $package eq 'main' && $version_fullname && !exists($vers{main}) ) {
650 $vers{$package} = $v;
654 # first non-comment line in undeclared package defines package main
655 elsif ( $package eq 'main' && !exists($vers{main}) && $line =~ /\w/ ) {
666 unless ( defined $vers{$package} && length $vers{$package} ) {
667 $vers{$package} = $v;
701 $pn++; # everybody gets their own package
703 #; package Module::Metadata::_version::p${pn};
839 my ($self, $package) = @_;
843 # check for specific package, if provided
844 return !! grep $_ eq $package, @indexable_packages if $package;
860 Module::Metadata - Gather package and POD information from perl module files
919 Constructs a C<Module::Metadata> object given a module or package name.
933 Returns the path to a module given the module or package name. A list
989 'Package::Name' => {
991 file => 'lib/Package/Name.pm'
1003 'Package::Name' => {
1005 file => 'Package/Name.pm'
1027 Returns the name of the package represented by this module. If there
1028 is more than one package, it makes a best guess based on the
1029 filename. If it's a script (i.e. not a *.pm) the package name is
1032 =head2 C<< version($package) >>
1035 package as returned by the C<name> method if no arguments are
1036 given. If given the name of a package it will attempt to return the
1037 version of that package if it is specified in the file.
1049 C<provides> method does. Invalid package names are not returned,
1050 for example "Foo:Bar". Strange but valid package names are
1066 =head2 C<< is_indexable($package) >> or C<< is_indexable() >>
1070 Returns a boolean indicating whether the package (if provided) or any package
1072 Note This only checks for valid C<package> declarations, and does not take any