-
-
25 Dec 2019 01:33:25 UTC
- Distribution: Package-MoreUtil
- Module version: 0.592
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (67 / 0 / 2)
- Kwalitee
Bus factor: 1- 88.11% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (15.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- FUNCTIONS
- FAQ
- HOMEPAGE
- SOURCE
- BUGS
- SEE ALSO
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
Package::MoreUtil - Package-related utilities
VERSION
This document describes version 0.592 of Package::MoreUtil (from Perl distribution Package-MoreUtil), released on 2019-12-25.
SYNOPSIS
use Package::MoreUtil qw( package_exists list_package_contents list_package_subs list_subpackages ); print "Package Foo::Bar exists" if package_exists("Foo::Bar"); my %content = list_package_contents("Foo::Bar"); my @subnames = list_package_subs("Foo::Bar"); my @subpkg = list_subpackages("Foo::Bar"); my @allsubpkg = list_subpackages("Foo::Bar", 1); # recursive
DESCRIPTION
DEPRECATION NOTICE: This module is deprecated in favor of Package::Stash and Package::Util::Lite.
FUNCTIONS
package_exists($name) => BOOL
Return true if package "exists". By "exists", it means that the package has been defined by
package
statement or some entries have been created in the symbol table (e.g.$Foo::var = 1;
will make theFoo
package "exist").This function can be used e.g. for checking before aliasing one package to another. Or to casually check whether a module has been loaded.
list_package_contents($name) => %res
Return a hash containing package contents. For example:
( sub1 => \&Foo::Bar::sub1, sub2 => \&Foo::Bar::sub2, '%h1' => \%Foo::Bar::h1, '@a1' => \@Foo::Bar::a1, ... )
This module won't list subpackages. Use list_subpackages() for that.
list_package_subs($pkg) => @subnames
Return a list containing subroutine names in package
$pkg
.list_subpackages($name[, $recursive]) => @res
List subpackages, e.g.:
( "Foo::Bar::Baz", "Foo::Bar::Qux", ... )
If $recursive is true, will also list subpackages of subpackages, and so on.
FAQ
How to list all existing packages?
You can recurse from the top, e.g.:
list_subpackages("", 1);
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Package-MoreUtil.
SOURCE
Source repository is at https://github.com/perlancar/perl-Package-MoreUtil.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Package-MoreUtil
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
SEE ALSO
Package::Util (currently empty/placeholder at the time of this writing)
AUTHOR
perlancar <perlancar@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2019, 2018, 2014, 2013 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Package::MoreUtil, copy and paste the appropriate command in to your terminal.
cpanm Package::MoreUtil
perl -MCPAN -e shell install Package::MoreUtil
For more information on module installation, please visit the detailed CPAN module installation guide.