summaryrefslogtreecommitdiff
path: root/dselect/methods/ftp/setup
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-01-11 19:57:35 +0100
committerGuillem Jover <guillem@debian.org>2013-05-08 04:58:08 +0200
commit17ae5451263121467ed9b0a45dfddc1c4336a930 (patch)
tree8d9e48f24cb18732378878949f4bb359ff07ed14 /dselect/methods/ftp/setup
parente1fba416fa57c7cb18e52cc994f6d3608fbfe7e7 (diff)
downloaddpkg-17ae5451263121467ed9b0a45dfddc1c4336a930.tar.gz
perl: Use my-style lexical loop iterator variables
The variables used on a foreach loop are local to that block, so if we wanted to use it after the loop is finished the last value would be gone. Fixes Variables::RequireLexicalLoopIterators. Warned-by: perlcritic
Diffstat (limited to 'dselect/methods/ftp/setup')
-rwxr-xr-xdselect/methods/ftp/setup7
1 files changed, 3 insertions, 4 deletions
diff --git a/dselect/methods/ftp/setup b/dselect/methods/ftp/setup
index 26da50d36..ae5d56571 100755
--- a/dselect/methods/ftp/setup
+++ b/dselect/methods/ftp/setup
@@ -123,15 +123,14 @@ sub download() {
my @dists = @{$_->[2]};
- my $dist;
- foreach $dist (@dists) {
+ foreach my $dist (@dists) {
my $dir = "$dist/binary-$arch";
print "Checking $dir...\n";
# if (!$ftp->pasv()) { print $ftp->message . "\n"; die 'error'; }
my @dirlst = $ftp->ls("$dir/");
my $got_pkgfile = 0;
- my $line = '';
- foreach $line (@dirlst) {
+
+ foreach my $line (@dirlst) {
if($line =~ /Packages/) {
$got_pkgfile=1;
}