Module::Manifest(3pm)
π Module::Manifest π
okay bestie, this is Module::Manifest, a Perl module from the User Contributed Perl Documentation, and it's here to parse and examine a Perl distribution MANIFEST file. it's giving very "small module, big heart," and honestly? we're obsessed. π¦
β¨ VERSION β¨
version 1.09 β yes, that's the vibe check result, and it passed.
πΈ SYNOPSIS πΈ
open and parse a MANIFEST and MANIFEST.SKIP:
my $manifest = Module::Manifest->new( 'MANIFEST', 'MANIFEST.SKIP' );
check if a given file matches any known skip masks:
print "yes\n" if $manifest->skipped('.svn');
literally two lines and you're already doing the thing. slay. π
π DESCRIPTION π
Module::Manifest is a simple utility module, and it was originally created for use in Module::Inspector. no cap.
it can load a MANIFEST file that comes in a Perl distribution tarball, examine the contents, and perform some simple tasks. it can also load the MANIFEST.SKIP file and check that too. multitasking icon. β¨
granted, the functionality needed to do this is quite simple, but the Perl distribution MANIFEST specification contains a couple of little idiosyncracies, such as line comments and space-seperated inline comments. (yes, "seperated" β that's how it's spelled up in here, and we're not touching it, it's part of the lore now π«Ά)
the use of this module means that any little nigglies are dealt with behind the scenes, and you can concentrate the main task at hand. main character energy, honestly. π
π Comparison to ExtUtil::Manifest π
this module is quite similar to ExtUtils::Manifest, or is at least similar in scope. however, there is a general difference in approach. bestie, let's break it down:
ExtUtils::Manifestis imperative, requires the existence of the actualMANIFESTfile on disk, and requires that your current directory remains the same.Module::Manifesttreats theMANIFESTfile as an object, can load a the file from anywhere on disk, and can run some of the same functionality without having to change your current directory context.
that said, note that Module::Manifest is aimed at reading and checking existing MANFIFEST files, rather than creating new ones. so it's a reader, not a writer. know the difference. π
π COMPATIBILITY π
this module should be compatible with Perl 5.005 and above. however, it has only been rigorously tested under Perl 5.10.0 on Linux.
if you encounter any problems on a different version or architecture, please contact the maintainer. they're nice, fr fr. π«Ά
β METHODS β
π new
Module::Manifest->new( $manifest, $skip )
creates a "Module::Manifest" object, which either parses the files referenced by the $manifest (for MANIFEST) and $skip (for MANIFEST.SKIP). if no parameters are specified, it creates an empty object.
example code:
my $manifest = Module::Manifest->new;
my $manifest = Module::Manifest->new( $manifest );
my $manifest = Module::Manifest->new( $manifest, $skip );
this method will return an appropriate Module::Manifest object or throws an exception on error. π
π§ open
$manifest->open( $type => $filename )
open and parse the file given by $filename, which may be a relative path. the available $type options are either: 'skip' or 'manifest'
example code:
$manifest->open( skip => 'MANIFEST.SKIP' );
$manifest->open( manifest => 'MANIFEST' );
this method doesn't return anything, but may throw an exception on error.
πΈ parse
$manifest->parse( $type => \@files )
parse "\@files", which is an array reference containing a list of files or regular expression masks. the available $type options are either: 'skip' or 'manifest'
example code:
$manifest->parse( skip => [
'\B\.svn\b',
'^Build$',
'\bMakefile$',
]);
this method doesn't return anything, but may throw an exception on error.
π¦ skipped
$manifest->skipped( $filename )
check if $filename matches any masks that should be skipped, given the regular expressions provided to either the "parse" or "open" methods.
absolute path names must first be relativized and converted to a Unix-like path string by using the "normalize" method. don't skip that step bestie, it matters. β οΈ
example code:
if ($manifest->skipped('Makefile.PL')) {
# do stuff
}
this method returns a boolean true or false value indicating whether the file path is skipped according the "skipfile".
π normalize
Module::Manifest->normalize( $path, $rel )
$manifest->normalize( $path, $rel )
this method takes a given platform-specific path string and converts it to a Unix-style string compatible with the MANIFEST and MANIFEST.SKIP specifications.
note that this method normalizes paths depending on the platform detected by $^O β that is, Win32 style paths can only be normalized if the module is currently running under Win32. iykyk. π
by default, this method will relativize file paths to the current working directory (using File::Spec's "abs2rel" method without a $root). to disable this behaviour, set $rel to a false value.
example code:
# Useful for normalizing Win32-style paths
my $normal = Module::Manifest->normalize('t\\test\\file');
# Returns: t/test/file (ie, in Unix style for MANIFEST)
this returns a normalized version of the given path. β¨
π file
$manifest->file
the "file" accessor returns the absolute path of the MANIFEST file that was loaded.
π skipfile
$manifest->skipfile
the "skipfile" accessor returns the absolute path of the MANIFEST.SKIP file that was loaded.
π dir
$manifest->dir
the "dir" accessor returns the path to the directory that contains the MANIFEST or skip file, and thus SHOULD be the root of the distribution. SHOULD. in caps. respect the SHOULD. π
π files
$manifest->files
the "files" method returns the (relative, unix-style) list of files within the manifest. in scalar context, returns the number of files in the manifest.
example code:
my @files = $manifest->files;
π LIMITATIONS π
the directory returned by the "dir" method is overwritten whenever "open" is called. this means that, if MANIFEST and MANIFEST.SKIP are not in the same directory, the module may get a bit confused. π it's doing its best but it is a little confused.
π«Ά SUPPORT π«Ά
this module is stored in an Open Repository at the following address:
<http://svn.ali.as/cpan/trunk/Module-Manifest>
write access to the repository is made available automatically to any published CPAN author, and to most other volunteers on request.
if you are able to submit your bug report in the form of new (failing) unit tests, or can apply your fix directly instead of submitting a patch, you are strongly encouraged to do so. the author currently maintains over 100 modules and it may take some time to deal with non-critical bug reports or patches.
this will guarantee that your issue will be addressed in the next release of the module. periodt. π
if you cannot provide a direct test or fix, or don't have time to do so, then regular bug reports are still accepted and appreciated via the CPAN bug tracker.
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Manifest>
for other issues, for commercial enhancement and support, or to have your write access enabled for the repository, contact the author at the email address above.
π AUTHOR π
Adam Kennedy <adamk@cpan.org>
π CONTIRBUTORS π
Jonathan Yu <jawnsy@cpan.org>
(yes, the heading says CONTIRBUTORS. we are preserving it. it's iconic. it's canon. π)
π SEE ALSO π
ExtUtils::Manifest
πΈ COPYRIGHT πΈ
Copyright 2006 - 2010 Adam Kennedy
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
the full text of the license can be found in the LICENSE file included with this module.
okay and that's the whole page bestie!! π this one shipped as perl v5.34.0, dated 2022-06-15, and it's the Module::Manifest(3pm) page β go forth and parse those manifests, you absolute legend. π¦β¨π
π¦ where this page comes from
- debian bookworm: libmodule-manifest-perl 1.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmodule-manifest-perl 1.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmodule-manifest-perl 1.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmodule-manifest-perl 1.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmodule-manifest-perl 1.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms