From 195f44c2da47b9f0df0461b593935d89619a5a0e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 11 Nov 2002 13:49:06 +0000 Subject: - use "foreach" instead of "for" in list context - use "for" instead of "foreach" when used a la C --- perl-install/printerdrake.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'perl-install/printerdrake.pm') diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index 86afe9e24..96ee46806 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -141,7 +141,7 @@ sub setup_printer_connection { my ($printer, $in, $upNetwork) = @_; # Choose the appropriate connection config dialog my $done = 1; - for ($printer->{TYPE}) { + foreach ($printer->{TYPE}) { /LOCAL/ and setup_local_autoscan ($printer, $in, $upNetwork) and last; /LPD/ and setup_lpd ($printer, $in, $upNetwork) and last; @@ -1601,7 +1601,7 @@ sub get_db_entry { $printer->{DBENTRY} = ""; my $make = uc($printer->{configured}{$queue}{queuedata}{make}); my $model = $printer->{configured}{$queue}{queuedata}{model}; - for my $key (keys %printer::thedb) { + foreach my $key (keys %printer::thedb) { if ((($::expert) && ($key =~ /^$make\|$model\|.*\(recommended\)$/)) || ((!$::expert) && ($key =~ /^$make\|$model$/))) { $printer->{DBENTRY} = $key; @@ -1613,7 +1613,7 @@ sub get_db_entry { $model =~ s/PS//; $model =~ s/PostScript//; $model =~ s/Series//; - for my $key (keys %printer::thedb) { + foreach my $key (keys %printer::thedb) { if ((($::expert) && ($key =~ /^$make\|$model\|.*\(recommended\)$/)) || ((!$::expert) && ($key =~ /^$make\|$model$/))) { $printer->{DBENTRY} = $key; @@ -1989,7 +1989,7 @@ sub setup_options { # enumerated option push(@choicelists, []); push(@shortchoicelists, []); - for my $choice (@{$printer->{ARGS}[$i]{vals}}) { + foreach my $choice (@{$printer->{ARGS}[$i]{vals}}) { push(@{$choicelists[$i]}, $choice->{comment}); push(@{$shortchoicelists[$i]}, $choice->{value}); if ($choice->{value} eq $optshortdefault) { @@ -3490,7 +3490,7 @@ What do you want to modify on this printer?", #- Which printer type did we have before (check beginning of #- URI) if ($printer->{configured}{$queue}) { - for my $type (qw(file lpd socket smb ncp postpipe)) { + foreach my $type (qw(file lpd socket smb ncp postpipe)) { if ($printer->{currentqueue}{connect} =~ /^$type:/) { $printer->{TYPE} = -- cgit v1.2.1