Search code examples
perltemptemporary-directory

How can I temporarily change the tmp directory Perl uses?


Some libraries I use seem to write stuff to /tmp.

I would like to change the 'temporary' directory location my script (and all the imported libraries) uses to /new/tmp/location. Needless to say, I don't want to effect anything outside my script (so e.g remounting /tmp is not an option).

How can I do that?


Solution

  • Many libraries will create temporary files in the directory specified by the TMPDIR environment variable, if it is set. Give it a try; if that doesn't help, you're going to have to say more about what libraries you are wanting to affect.