From 949a885497d3d05e4dc0dc20e52ecb758d9b677c Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 14 Nov 2000 15:31:59 +0000 Subject: removed foreach (<... which are eating memory --- perl-install/network.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'perl-install/network.pm') diff --git a/perl-install/network.pm b/perl-install/network.pm index 126bb00fc..5e687c857 100644 --- a/perl-install/network.pm +++ b/perl-install/network.pm @@ -32,7 +32,8 @@ sub read_resolv_conf { my %netc; local *F; open F, $file or die "cannot open $file: $!"; - foreach () { + local $_; + while () { /^\s*nameserver\s+(\S+)/ and $netc{shift @l} = $1; } \%netc; @@ -88,7 +89,8 @@ sub write_resolv_conf { my (%search, %dns, @unknown); local *F; open F, $file; - foreach () { + local $_; + while () { /^[#\s]*search\s+(.*?)\s*$/ and $search{$1} = $., next; /^[#\s]*nameserver\s+(.*?)\s*$/ and $dns{$1} = $., next; /^.*# ppp temp entry\s*$/ and next; -- cgit v1.2.1