Single interface to deal with file archives.
use Archive::Any; my $archive = Archive::Any->new($archive_file); my @files = $archive->files; $archive->extract; my $type = $archive->type; $archive->is_impolite; $archive->is_naughty;
This module is a single interface for manipulating different archive formats. Tarballs, zip files, etc.
my $archive = Archive::Any->new($archive_file); my $archive = Archive::Any->new($archive_file, $type); $type is optional. It lets you force the file type in-case Archive::Any can't figure it out.
$archive->extract; $archive->extract($directory); Extracts the files in the archive to the given $directory. If no $directory is given, it will go into the current working directory.
my @file = $archive->files; A list of files in the archive.
my $mime_type = $archive->mime_type(); Returns the mime type of the archive.
my $is_impolite = $archive->is_impolite; Checks to see if this archive is going to unpack into the current directory rather than create its own.
my $is_naughty = $archive->is_naughty; Checks to see if this archive is going to unpack outside the current directory.
my $type = $archive->type; Returns the type of archive. This method is provided for backwards compatibility in the Tar and Zip plugins and will be going away soon in favor of \*(C`mime_type\*(C'.
For detailed information on writing plugins to work with Archive::Any, please see the pod documentation for Archive::Any::Plugin.
Clint Moore <[email protected]>
Michael G Schwern
Archive::Any::Plugin
You can find documentation for this module with the perldoc command.
perldoc Archive::Any
You can also look for information at:
AnnoCPAN: Annotated \s-1CPAN\s0 documentation <http://annocpan.org/dist/Archive-Any>
\s-1CPAN\s0 Ratings <http://cpanratings.perl.org/d/Archive-Any>
\s-1RT:\s0 \s-1CPAN\s0's request tracker <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Archive-Any>
Search \s-1CPAN\s0 <http://search.cpan.org/dist/Archive-Any>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>