diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-03 12:53:13 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-03 12:53:13 +0000 |
commit | bc42f5ff04803ece22fd4f444f6b16c644c7d84a (patch) | |
tree | 10ecfc7c6b9eed6f5361506990d49353c066682a /perl-install | |
parent | 7a352652b5b1a5711b1fd3e0a918f84ea6f1fc95 (diff) | |
download | drakx-bc42f5ff04803ece22fd4f444f6b16c644c7d84a.tar drakx-bc42f5ff04803ece22fd4f444f6b16c644c7d84a.tar.gz drakx-bc42f5ff04803ece22fd4f444f6b16c644c7d84a.tar.bz2 drakx-bc42f5ff04803ece22fd4f444f6b16c644c7d84a.tar.xz drakx-bc42f5ff04803ece22fd4f444f6b16c644c7d84a.zip |
(read_resolv_conf): simplify
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/network/network.pm | 9 |
1 files changed, 2 insertions, 7 deletions
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 (<F>) { - /^\s*nameserver\s+(\S+)/ and $netc{shift @l} = $1; - } + my %netc = mapn { $_[0] => $_[1] } [ qw(dnsServer dnsServer2 dnsServer3) ], \@l; \%netc; } |