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/printerdrake.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'perl-install/printerdrake.pm') diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 992b61a59..86afe9e24 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -1601,8 +1601,7 @@ sub get_db_entry { $printer->{DBENTRY} = ""; my $make = uc($printer->{configured}{$queue}{queuedata}{make}); my $model = $printer->{configured}{$queue}{queuedata}{model}; - my $key; - for $key (keys %printer::thedb) { + for my $key (keys %printer::thedb) { if ((($::expert) && ($key =~ /^$make\|$model\|.*\(recommended\)$/)) || ((!$::expert) && ($key =~ /^$make\|$model$/))) { $printer->{DBENTRY} = $key; @@ -1614,7 +1613,7 @@ sub get_db_entry { $model =~ s/PS//; $model =~ s/PostScript//; $model =~ s/Series//; - for $key (keys %printer::thedb) { + for my $key (keys %printer::thedb) { if ((($::expert) && ($key =~ /^$make\|$model\|.*\(recommended\)$/)) || ((!$::expert) && ($key =~ /^$make\|$model$/))) { $printer->{DBENTRY} = $key; @@ -1990,8 +1989,7 @@ sub setup_options { # enumerated option push(@choicelists, []); push(@shortchoicelists, []); - my $choice; - for $choice (@{$printer->{ARGS}[$i]{vals}}) { + for my $choice (@{$printer->{ARGS}[$i]{vals}}) { push(@{$choicelists[$i]}, $choice->{comment}); push(@{$shortchoicelists[$i]}, $choice->{value}); if ($choice->{value} eq $optshortdefault) { @@ -2590,7 +2588,7 @@ sub check_network { [ { val => \$choice, type => 'list', list => [ N("Configure the network now"), N("Go on without configuring the network") ]} ] )) { - if ($choice eq N("Configure the network now")){ + if ($choice eq N("Configure the network now")) { if ($::isInstall) { require network::netconnect; network::netconnect::main @@ -3491,9 +3489,8 @@ What do you want to modify on this printer?", $printer->{DBENTRY} = undef; #- Which printer type did we have before (check beginning of #- URI) - my $type; if ($printer->{configured}{$queue}) { - for $type (qw(file lpd socket smb ncp postpipe)) { + for my $type (qw(file lpd socket smb ncp postpipe)) { if ($printer->{currentqueue}{connect} =~ /^$type:/) { $printer->{TYPE} = -- cgit v1.2.1