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/Xconfigurator.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'perl-install/Xconfigurator.pm') diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 98ab284ea..163801f13 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -57,7 +57,8 @@ sub readCardsDB { COMMENT => sub {}, }; - foreach () { $lineno++; + local $_; + while () { $lineno++; s/\s+$//; /^#/ and next; /^$/ and next; @@ -80,7 +81,8 @@ sub cardName2RealName { my $file = "/usr/X11R6/lib/X11/CardsNames"; my ($name) = @_; local *F; open F, $file or die "can't find $file\n"; - foreach () { chop; + local $_; + while () { chop; my ($name_, $real) = split '=>'; return $real if $name eq $name_; } @@ -100,9 +102,9 @@ sub readMonitorsDB { %monitors and return; - local *F; - open F, $file or die "can't open monitors database ($file): $!"; - my $lineno = 0; foreach () { + local *F; open F, $file or die "can't open monitors database ($file): $!"; + local $_; + my $lineno = 0; while () { $lineno++; s/\s+$//; /^#/ and next; @@ -384,9 +386,9 @@ sub testConfig($) { #- restart_xfs; my $f = $tmpconfig . ($o->{card}{use_xf4} && "-4"); - local *F; - open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |"; - foreach () { + local *F; open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |"; + local $_; + while () { $o->{card}{memory} ||= $2 if /(videoram|Video RAM):\s*(\d*)/; # look for clocks -- cgit v1.2.1