dir_unlink_on_destroy#
Toggle or query whether a File::Temp::Dir object removes its directory tree on destruction.
Synopsis#
my $flag = $dir->unlink_on_destroy; # getter
$dir->unlink_on_destroy(0); # keep the tree
What you get back#
The new (or current) cleanup flag as an integer.
Examples#
my $dir = File::Temp->newdir;
$dir->unlink_on_destroy(0);
## $dir's path survives after $dir goes out of scope
Edge cases#
Called on something that is not a
File::Temp::Dir: returns0.Writes to the object’s
CLEANUPhash slot; reads by other code see the updated value.
Differences from upstream#
Fully compatible with upstream File::Temp 0.2312.
See also#
File::Temp->newdir— constructor whose default isCLEANUP => 1.cleanup— force-drain all registered cleanups now.