Egg::Plugin::File::Rotate - Plugin that does file rotation.
use Egg qw/ File::Rotate /; # The file made before is reproduced before the file is saved. if ( -e $file_path ) { $e->rotate($file_path, stock => 5 ); } my $fh= FileHandle->new("> $file_path") || return do { # When the problem occurs, it returns it. $e->rotate($file_path, reverse => 1 ); die $!; };
The number is allocated in an old file, and rotating operation is done.
To TARGET_FILE_PATH. Rename is done by the file name that puts one.
If TARGET_FILE_PATH.1 already exists, the rotation processes generations of the number specified to make it to TARGET_FILE_PATH.2 for 'stock' of ARGS_HASH.
If reverse of ARGS_HASH is effective, opposite operation is done.
An easy report for the rotation to have succeeded is returned with ARRAY.
Egg::Release,
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.