From b27238ebb2d98f4c4edac4b768c952eb91ee2c3a Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Tue, 26 Jun 2001 13:43:51 +0000 Subject: [PATCH] Be more portable in finding out the home directory, and use File::Spec to do the concat. (Come to think of it, couldn't File::Spec provide for a ->homedir method?) p4raw-id: //depot/perl@10962 --- lib/Net/Config.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Net/Config.pm b/lib/Net/Config.pm index 30a65fd..e0dd1d9 100644 --- a/lib/Net/Config.pm +++ b/lib/Net/Config.pm @@ -40,8 +40,9 @@ if ( -f $file ) { } } if ($< == $> and !$CONFIGURE) { - my $home = eval { (getpwuid($>))[7] } || $ENV{HOME}; - $file = $home . "/.libnetrc"; + use File::Spec; + my $home = eval { (getpwuid($>))[7] } || $ENV{HOME} || $ENV{HOMEDRIVE} || $ENV{HOMEPATH} || File::Spec->curdir; + $file = File::Spec->catfile($home, ".libnetrc"); $ref = eval { do $file } if -f $file; %NetConfig = (%NetConfig, %{ $ref }) if ref($ref) eq 'HASH'; -- 2.7.4