Archiv...::Lite(3pm)
π NAME π
Archive::Any::Lite β it's a simple CPAN package extractor, bestie π (yes this is the Archiv...::Lite(3pm) page, the manual name got trimmed cute in the header but we know her π )
β¨ SYNOPSIS β¨
use strict;
use warnings;
use Archive::Any::Lite;
local $Archive::Any::Lite::IGNORE_SYMLINK = 1; # for safety
my $tarball = 'foo.tar.gz';
my $archive = Archive::Any::Lite->new($tarball);
$archive->extract('into/some/directory/');
look at that, it literally just works π«Ά
π¦ DESCRIPTION π¦
okay so first thing: this is a fork of Archive::Any, written by Michael Schwern and Clint Moore. so like, the origin story is real.
The main difference? This one works properly even when you fork() β not me being dramatic, that's the whole flex β and it may need less memory to extract a tarball. slay.
On the other hand, lowkey there's some tradeoffs, no cap:
- it isn't pluggable β the only file formats it supports are the ones used in the CPAN toolchains, that's it, that's the list
- it doesn't check mime types (at least as of this writing, okay, at least as of this writing π)
π METHODS π
πΈ new
my $archive = Archive::Any::Lite->new($archive_file);
my $archive = Archive::Any::Lite->new($archive_file, {tar_filter => qr/foo/});
creates an object, periodt. and if you're feeling fancy you can pass an optional hash reference for finer control π
πΈ extract
$archive->extract;
$archive->extract($directory);
$archive->extract($directory, {tar_filter => qr/foo/});
extracts the files in the archive into the given $directory. and if you don't hand it a $directory? it just goes into the current working directory. (main character energy, honestly π
)
you can also pass an optional hash reference for finer control. but listen β if you pass it, the options you passed in "new" get ignored. like, fully ignored. so pick your lane π«Ά
πΈ files
my @file = $archive->files;
gives you a list of files in the archive. that's it. iconic. β¨
πΈ is_impolite
my $is_impolite = $archive->is_impolite;
checks whether this archive is gonna unpack into the current directory instead of creating its own lil folder. rude of it, honestly. π
πΈ is_naughty
my $is_naughty = $archive->is_naughty;
checks whether this archive is gonna unpack outside the current directory. that's the naughty one. keep an eye on her π
πΈ type
deprecated. it's here for backward compatibility only, bestie, so like... don't build anything new on it π
π«Ά GLOBAL VARIABLE π«Ά
π $IGNORE_SYMLINK
if you set it to true, then symlinks (and hardlinks, for tarball) will be ignored.
fr fr, the SYNOPSIS sets this to 1 for safety and honestly? listen to the SYNOPSIS.
π SEE ALSO π
- Archive::Any
- Archive::Tar::Streamed
π AUTHOR π
Archive::Any is written by Michael G Schwern and Clint Moore. π
and Kenichi Ishigaki, <ishigaki@cpan.org> β that's the one who forked her into existence π¦
π COPYRIGHT AND LICENSE π
Copyright (C) 2012 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πΈ
okay that's the whole page!! and for the lil sign-off β this was the perl v5.36.0 build of the doc, dated 2022-10-13, from the Archiv...::Lite(3pm) page. go extract something cute, stay safe out there, and set your $IGNORE_SYMLINK π
β¨π
π¦ where this page comes from
- ubuntu noble: libarchive-any-lite-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libarchive-any-lite-perl 0.11-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libarchive-any-lite-perl 0.11-3 Β· 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