Subject: | More complete check for $home |
Date: | Tue, 18 Sep 2018 16:12:31 +0000 |
To: | "bug-File-BaseDir [...] rt.cpan.org" <bug-File-BaseDir [...] rt.cpan.org> |
From: | Todd Richmond <trichmond [...] proofpoint.com> |
When $ENV{HOME} is not set, fall back to the user’s entry from /etc/passwd on non-MSWin32 systems. This will allow applications that don’t run under a shell that set HOME to still use their own values rather than root’s
my $home = $ENV{HOME};
$home =(getpwuid($>))[7] unless ($home || $^O eq ‘MSWin32’);
unless ($home) {
…