Backup::Zip - A Zip Role for classes using Moose
version 0.02
package CanZipThings; use Moose; with 'Backup::Zip'; sub files_to_zip() { return ( '/etc/passwd', '/etc/bashrc', ); } package main; use CanZipThings; my $canzip = CanZipThings->new; $canzip->make_zip("/tmp/somezip.zip");
This is a Role and it provides a zip function to the consumer class.
Backup::Zip is a Role and it depends on the files_to_zip() method which it expects the consumer class to provide. This method will be used by make_zip() in order to get an array of the files it will zip so the return value should be a list with filepaths.
This method uses Archive::Zip to zip your files and stores them in the path indicated by $zip. If you provide no arguments , it will 'confess' with an error message. You will also receive warnings for all the files that don't exist.
This method will unzip the files found at the path $what to the path $where.
If this module has any bugs please report them to rt.cpan.org or my email.
Also if you have any suggestions on the code you are welcome to drop me an e-mail.
Stefan Petrea, <stefan.petrea at gmail.com>
<stefan.petrea at gmail.com>
To install Backup::Email, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Backup::Email
CPAN shell
perl -MCPAN -e shell install Backup::Email
For more information on module installation, please visit the detailed CPAN module installation guide.