From bc42f5ff04803ece22fd4f444f6b16c644c7d84a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 3 Dec 2002 12:53:13 +0000 Subject: (read_resolv_conf): simplify --- perl-install/network/network.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index 2f20d131a..a7994a18a 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -26,14 +26,9 @@ sub read_conf { sub read_resolv_conf { my ($file) = @_; - my @l = qw(dnsServer dnsServer2 dnsServer3); - my %netc; + my @l = map { if_(/^\s*nameserver\s+(\S+)/, $1) } cat_($file); - local *F; open F, $file or die "cannot open $file: $!"; - local $_; - while () { - /^\s*nameserver\s+(\S+)/ and $netc{shift @l} = $1; - } + my %netc = mapn { $_[0] => $_[1] } [ qw(dnsServer dnsServer2 dnsServer3) ], \@l; \%netc; } -- cgit v1.2.1