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;