Given the use case, it's worth looking at Test::TempDir::Tiny as it would seem to do exactly what you want with a clean interface. (Edit - it wraps File::Temp so is essentially the same as 11154828 but more concise).
I've been using it for a while and it works pretty well, barring issues deleting directories when antivirus software is scanning files when the module tries to delete them. That issue is not unique to Test::TempDir::Tiny, though.
In reply to Re^3: File::Temp does not cleanup() on demand
by swl
in thread File::Temp does not cleanup() on demand
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |