Skip Menu |

This queue is for tickets about the Cache-FastMmap CPAN distribution.

Report information
The Basics
Id: 28330
Status: resolved
Priority: 0/
Queue: Cache-FastMmap

People
Owner: Nobody in particular
Requestors: andreas.marienborg [...] gmail.com
Cc:
AdminCc:

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



Subject: the use of $^O is problematic
The following line in Cache/FastMmap.pm is problematic for meg $share_file = ($^O =~ /win/i ? "c:\\sharefile" : "/tmp/sharefile"); The reason is that on my system $^O evaluates to "darwin", which indeed matches /win/i, and thus results in some horrendous files named c:\\sharefile-pid-timestamp in my $CWD. In addition $^O is also the platform that the perl binary was compiled on, and not necessarily the one it runs on. Attached is a patch that does detection in the same way that File::HomeDir does it.
Subject: cache-fastmmap-win-detection.patch
--- FastMmap.pm.orig 2007-07-17 10:24:01.000000000 +0200 +++ FastMmap.pm 2007-07-17 10:24:28.000000000 +0200 @@ -402,7 +402,7 @@ # Work out cache file and whether to init my $share_file = $Args{share_file}; if (!$share_file) { - $share_file = ($^O =~ /win/i ? "c:\\sharefile" : "/tmp/sharefile"); + $share_file = ($^O eq "MSWin32" ? "c:\\sharefile" : "/tmp/sharefile"); $share_file .= "-" . $$ . "-" . time; } $Self->{share_file} = $share_file;
This was fixed in 1.19