summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-26 13:43:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-26 13:43:51 +0000
commitb27238ebb2d98f4c4edac4b768c952eb91ee2c3a (patch)
treed1c4fe1b990c481fe255865d811fb16eb19acc6f /lib/Net
parent51d2bbcca5d4cebbfa5f145c68787d3b7bdd42c4 (diff)
downloadperl-b27238ebb2d98f4c4edac4b768c952eb91ee2c3a.tar.gz
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
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Config.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Net/Config.pm b/lib/Net/Config.pm
index 30a65fd5e9..e0dd1d9969 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';