Skip Menu |
 

This queue is for tickets about the File-Spec CPAN distribution.

Report information
The Basics
Id: 53236
Status: new
Priority: 0/
Queue: File-Spec

People
Owner: Nobody in particular
Requestors: dfs+pause [...] roaringpenguin.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: File::Spec should NOT cache $ENV{TMPDIR}
File::Spec caches $ENV{TMPDIR}; see this code in File/Spec/Unix.pm:

sub tmpdir {
    return $tmpdir if defined $tmpdir;
    $tmpdir = $_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp" );
}

This prevents you from being able to change $ENV{TMPDIR} on the fly.  Arguably, you shouldn't do that
because you should just invoke File::Temp (which calls File::Spec) with a proper directory argument, but
often you use Perl modules that internally call File::Temp and over which you have no control.  It is therefore
desirable not to cache $ENV{TMPDIR}, but to reread it out of the environment every time.

Regards,

David.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.