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

People
Owner: Nobody in particular
Requestors: bricas [...] cpan.org
Cc:
AdminCc:

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



Subject: $ENV{ TMPDIR } gets autovivifed in File::Spec::Win32::tmpdir()
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/HTTP.pm 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 Win32.pm $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
use Test::More tests => 2; x( $ENV{ TMPDIR } ); ok( !exists $ENV{ TMPDIR } ); x( @ENV{ qw( TMPDIR ) } ); ok( !exists $ENV{ TMPDIR } ); sub x { }
From: info [...] whawes.co.uk
[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