From 2db19d156087ccce3037b2bd2da1042280e17904 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 11 Nov 2002 13:40:09 +0000 Subject: - do not use "foreach $var (...) {...}" use "foreach my $var (...) {...}" instead (only pb are functions called in {...} that could use $var, none found except in commands.pm) - various small syntax enhancements to please perl_checker --- perl-install/partition_table/mac.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'perl-install/partition_table') diff --git a/perl-install/partition_table/mac.pm b/perl-install/partition_table/mac.pm index 45c614139..33b63aa99 100644 --- a/perl-install/partition_table/mac.pm +++ b/perl-install/partition_table/mac.pm @@ -105,9 +105,8 @@ sub read($$) { sysread F, $tmp, psizeof($bz_format) or die "error while reading bz \(Block Zero\) in sector $sector"; my %info; @info{@$bz_fields} = unpack $bz_format, $tmp; - my $i; - foreach $i (0 .. $info{bzDrvrCnt}-1) { + foreach my $i (0 .. $info{bzDrvrCnt}-1) { sysread F, $tmp, psizeof($dd_format) or die "error while reading driver data in sector $sector"; my %dd; @dd{@$dd_fields} = unpack $dd_format, $tmp; push @{$info{ddMap}}, \%dd; @@ -129,7 +128,7 @@ sub read($$) { c::lseek_sector(fileno(F), $sector, 512) or die "reading of partition in sector $sector failed"; my @pt; - for ($i=0;$i<$partmapsize;$i++) { + for (my $i=0;$i<$partmapsize;$i++) { my $part; sysread F, $part, psizeof($p_format) or die "error while reading partition info in sector $sector"; @@ -240,8 +239,7 @@ sub write($$$;$) { # Since we didn't create any new drivers, let's try and match up our driver records with out partitons and see if any are missing. $info->{bzDrvrCnt} = 0; my @ddstowrite; - my $dd; - foreach $dd (@{$info->{ddMap}}) { + foreach my $dd (@{$info->{ddMap}}) { foreach (@partstowrite) { if ($dd->{ddBlock} == $_->{pPBlockStart}) { push @ddstowrite, $dd; -- cgit v1.2.1