summaryrefslogtreecommitdiff
path: root/lib/Net/Config.pm
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2001-10-26 13:11:00 +0000
committerGraham Barr <gbarr@pobox.com>2001-10-26 13:11:00 +0000
commit302c2e6b3178d72ea1114a76af5852e6680bacc8 (patch)
tree2fb3cf8fbf47ae55b4e6d7cd6e869f7d4f102bea /lib/Net/Config.pm
parentdf3728a2a53a64c63edf08a4429a7a57b76ca4aa (diff)
downloadperl-302c2e6b3178d72ea1114a76af5852e6680bacc8.tar.gz
Sync libnet modules with what will be libnet-1.08
p4raw-id: //depot/perl@12679
Diffstat (limited to 'lib/Net/Config.pm')
-rw-r--r--lib/Net/Config.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Net/Config.pm b/lib/Net/Config.pm
index 9dd66ba227..5a262fd0f8 100644
--- a/lib/Net/Config.pm
+++ b/lib/Net/Config.pm
@@ -13,7 +13,7 @@ use strict;
@EXPORT = qw(%NetConfig);
@ISA = qw(Net::LocalCfg Exporter);
-$VERSION = "1.05"; # $Id: //depot/libnet/Net/Config.pm#9 $
+$VERSION = "1.08"; # $Id: //depot/libnet/Net/Config.pm#13 $
eval { local $SIG{__DIE__}; require Net::LocalCfg };
@@ -37,28 +37,29 @@ my $file = __FILE__;
my $ref;
$file =~ s/Config.pm/libnet.cfg/;
if ( -f $file ) {
- $ref = eval { do $file };
+ $ref = eval { local $SIG{__DIE__}; do $file };
if (ref($ref) eq 'HASH') {
%NetConfig = (%NetConfig, %{ $ref });
$LIBNET_CFG = $file;
}
}
if ($< == $> and !$CONFIGURE) {
- my $home = eval { (getpwuid($>))[7] } || $ENV{HOME};
+ my $home = eval { local $SIG{__DIE__}; (getpwuid($>))[7] } || $ENV{HOME};
+ $home ||= $ENV{HOMEDRIVE} . ($ENV{HOMEPATH}||'') if defined $ENV{HOMEDRIVE};
if (defined $home) {
$file = $home . "/.libnetrc";
- $ref = eval { do $file } if -f $file;
+ $ref = eval { local $SIG{__DIE__}; do $file } if -f $file;
%NetConfig = (%NetConfig, %{ $ref })
if ref($ref) eq 'HASH';
}
}
my ($k,$v);
while(($k,$v) = each %NetConfig) {
- $v = [ $v ]
- if($k =~ /_hosts$/ && !ref($v));
+ $NetConfig{$k} = [ $v ]
+ if($k =~ /_hosts$/ && !ref($v));
}
-# Take a hostname and determine if it is inside te firewall
+# Take a hostname and determine if it is inside the firewall
sub requires_firewall {
shift; # ignore package
@@ -284,6 +285,6 @@ If true then C<Configure> will check each hostname given that it exists
=for html <hr>
-I<$Id: //depot/libnet/Net/Config.pm#9 $>
+I<$Id: //depot/libnet/Net/Config.pm#13 $>
=cut