|keep||The number of files to keep. A negative number will reverse the strategy. See option reverse below.|
Specifies the purge strategy.
Default (and only allowed) value is by_age.
This option is for purgedir only. The other subroutines should not be provided with a strategy option.
If this is a reference to a subroutine, this subroutine is called with
arguments ($file,$dir) and must return true for the file to be
included in the list of candidates,
If this is a regular expression, the file file will be included only if the expression matches the file name.
If true, the strategy will be reversed. For example, if the strategy
is by_age, the oldest files will be kept instead of the newest
Another way to reverse the strategy is using a negative keep value. This is not unlike Perls array subscripts, which count from the end if negative.
A negative keep value can be combined with reverse to reverse the reversed strategy again.
|verbose||Verbosity of messages. Default value is 1, which will report the names of the files being removed. A value greater than 1 will produce more messages about whats going on. A value of 0 (zero) will suppress messages.|
|debug||For internal debugging only.|
|test||If true, no files will be removed. For testing.|
Subroutine purgedir is exported by default.
Subroutine purgedir_by_age may be exported on demand.
Calling purgedir_by_age() is roughly equivalent to calling purgedir() with an options hash that includes strategy = by_age>.
The variable $Dir::Purge::VERSION may be used to inspect the version of the module.
Johan Vromans (email@example.com) wrote this module.
This program is Copyright 2000 by Squirrel Consultancy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the Artistic License which comes with Perl.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.
|perl v5.20.3||DIR::PURGE (3)||2006-09-19|