in reply to tempdir with template fails
As imp mentioned, this is behavior is documented. Unfortunately, the source code follows the docs. :-) I was hoping tempdir accepted a SUFFIX parameter just as tempfile does, but it does not (as of version 0.16).
If you really want your temp dir to have an extension, you could still use File::Temp but it would require a bit more work.
I'll be the first to say that the solution enumerated above is an ugly hack. If it were me, I'd use extensionless directory names or just check to see if it existed before I tried to create it. Do you really need the power of File::Temp for this? If you're not creating multiple temp dirs simultaneously this approach seems like overkill.
|
|---|