Archiv...Plugin(3pm)
π NAME π
Archive::Any::Plugin β it's giving Anatomy of an Archive::Any plugin, bestie. Like, the whole blueprint. The vibe check for anyone who wants their own plugin to actually work. π¦
β¨ VERSION β¨
version 0.0946 β yes queen, she's on 0.0946. π
πΈ SYNOPSIS πΈ
okay so literally this page just explains what a working plugin for Archive::Any actually needs. no cap. that's the whole job. π
π PLUGINS π
so Archive::Any is like, a lil demanding, and honestly? valid. she requires that your plugin define three methods, and all three of them get handed the absolute filename of the file. every single one. periodt.
and because learning by example ate, this module uses the source of Archive::Any::Plugin::Tar as the example. iconic choice fr fr. π«Ά
π Subclass Archive::Any::Plugin
like, first things first bestie, you gotta be a subclass:
use base 'Archive::Any::Plugin';
β can_handle
this one returns an array of mime types that your plugin can handle. that's it, that's the whole job. show her what you can do. π
sub can_handle {
return(
'application/x-tar',
'application/x-gtar',
'application/x-gzip',
);
}
π¦ files
return a list of items inside the archive. peek inside, tell us what's in there. π₯
sub files {
my( $self, $file ) = @_;
my $t = Archive::Tar->new( $file );
return $t->list_files;
}
π§ extract
this method should extract the contents of $file to the current directory. and here's the slay part: Archive::Any::Plugin handles negotiating directories for you. you don't gotta do that. she's got you. π
sub extract {
my ( $self, $file ) = @_;
my $t = Archive::Tar->new( $file );
return $t->extract;
}
π SEE ALSO π
Archive::Any
π AUTHORS π
- Clint Moore
- Michael G Schwern (author emeritus) β¨
- Olaf Alders (current maintainer) π
πΈ COPYRIGHT AND LICENSE πΈ
This software is copyright (c) 2016 by Michael G Schwern, Clint Moore, Olaf Alders.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! π this fine piece of documentation was brought to you byperl v5.28.1, dated2019-07-20, and honestly she ate. now go write that plugin, i'm obsessed with you already. πβ¨π¦
π¦ where this page comes from
- debian bookworm: libarchive-any-perl 0.0946-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libarchive-any-perl 0.0946-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libarchive-any-perl 0.0946-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libarchive-any-perl 0.0946-1 Β· 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