Skip Menu |

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

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

Owner: Nobody in particular
Requestors: bricas [...]

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

Subject: $ENV{ TMPDIR } gets autovivifed in File::Spec::Win32::tmpdir()
Download (untitled) / with headers
text/plain 864b
Hi! This took me some time to catch, but Catalyst was throwing some errors in a section of code that looked like this: local %ENV = ( ..., %ENV ); warning: Use of uninitialized value in list assignment at C:/Perl/site/lib/Catalyst/Engine/ line 185. Apparently, Catalyst::Plugin::Session::Store::File uses Cache::FileCache, which will store files in a temp directory which it calculates via File::Spec::tmpdir(). Because of the way _tmpdir() is called from that function: # line 63 of $tmpdir = $self->_tmpdir( @ENV{qw(TMPDIR TEMP TMP)}, this will auto-vivify those keys in the %ENV hash -- and thus Catalyst will throw errors because there are now undef values in that hash! I propose that like 63 be writted as: $tmpdir = $self->_tmpdir( $ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}, See the attached test file for a quick example. Cheers, -Brian
Download autovivify.t
text/x-perl 215b
use Test::More tests => 2; x( $ENV{ TMPDIR } ); ok( !exists $ENV{ TMPDIR } ); x( @ENV{ qw( TMPDIR ) } ); ok( !exists $ENV{ TMPDIR } ); sub x { }
From: info [...]
Download (untitled) / with headers
text/plain 252b
[BRICAS - Wed Nov 16 14:37:23 2005]: Show quoted text
> I propose that like 63 be writted as: > $tmpdir = $self->_tmpdir( $ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP},
Seconded - I had the same problem with File::Spec::Win32 1.6 and this patch fixed it for me. Regards Will

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

Please report any issues with to