Archive::Any::Plugin
Anatomy of an Archive::Any plugin.
- Provided by: libarchive-any-perl (Version: 0.0942-2)
- Report a bug
Anatomy of an Archive::Any plugin.
version 0.0942
Explains what is required for a working plugin to Archive::Any.
Archive::Any requires that your plugin define three methods, all of which are passed the absolute filename of the file. This module uses the source of Archive::Any::Plugin::Tar as an example.
use base 'Archive::Any::Plugin';
sub can_handle {
return(
'application/x-tar',
'application/x-gtar',
'application/x-gzip',
);
}
sub files {
my( $self, $file ) = @_;
my $t = Archive::Tar->new( $file );
return $t->list_files;
}
sub extract {
my ( $self, $file ) = @_;
my $t = Archive::Tar->new( $file );
return $t->extract;
}
Archive::Any
This software is copyright (c) 2015 by 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.