summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/network.pm9
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;
}