in reply to Re^2: File::Temp does not cleanup() on demand
in thread File::Temp does not cleanup() on demand

Then maybe use the CLEANUP => 1 but set $KEEP_ALL = 1 when a test fails.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: File::Temp does not cleanup() on demand
by bliako (Abbot) on Oct 05, 2023 at 13:48 UTC

    choroba++ your suggestion does it

    use strict; use warnings; use File::Temp 'tempdir'; $File::Temp::KEEP_ALL = 1; my $x = tempdir(CLEANUP=>1); print "tmp $x\n"; # exit(1); # this will retain it # ... # on successful end of test done_testing; $File::Temp::KEEP_ALL = 0; File::Temp::cleanup(); if( -d $x ){ print "still there ($x) ...\n" }

    thanks a lot (for reading the whole manual!)