Ron Savage wrote: > On Sat, 08 Mar 2003 22:28:09 -0500, Scott R. Godin wrote: > > Hi Scott > >>I've written a very nice module-reporting script that helps me to >>stay on >>top of installed modules and easily see when they require updates >>from CPAN >>for bugfixes. >> >>http://www.webdragon.net/mr/ > > Great program! > > I made a small change to get it working under MS Windows: > --- modulereport.pl Sun Mar 23 18:57:36 2003 > +++ \scripts\bin\modulereport.pl Sun Mar 23 18:57:32 2003 > @@ -46,9 +46,8 @@ > ); > > my $storefile = File::Spec->catfile( > - File::Spec->rootdir(), > - 'tmp', > - "$ENV{USER}_modules.stor" > + $ENV{'TEMP'}, > + "perl_modules.stor" > ); > > In other words: > o I don't have $USER defined > o I don't have /tmp > o File::Spec -> rootdir() leads to /C:/tmp/..., which doesn't work >
Yes, unfortunately there's no default $ENV{TEMP} on unix.. I've been considering using File::Temp, File::MkTemp, or IO::File instead, but just haven't gotten around to futzing with it. :-) File::Spec would be the most portable way to specify the directory path, but that's as far as I've gotten. Originally I ported this from the MacPerl version I started playing with the idea on, and then added the unix /tmp conventions to make certain things easier for myself.