diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-11-19 14:54:23 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-11-19 14:54:23 -0500 |
commit | 8ceb2df1b9e3368e765076b23ee0ecd4a2532a46 (patch) | |
tree | 00b5e3faf78158e186798f383a1d023b0906021d /Debian | |
parent | 25d57ca95f7571e13dbba4a0ae82c43d5e0e5a06 (diff) | |
download | debhelper-8ceb2df1b9e3368e765076b23ee0ecd4a2532a46.tar.gz |
use foreach instead of for when looping thru array
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Debhelper/Buildsystem.pm | 2 | ||||
-rw-r--r-- | Debian/Debhelper/Dh_Buildsystems.pm | 14 | ||||
-rw-r--r-- | Debian/Debhelper/Dh_Lib.pm | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/Debian/Debhelper/Buildsystem.pm b/Debian/Debhelper/Buildsystem.pm index 5b3423e6..f729c0da 100644 --- a/Debian/Debhelper/Buildsystem.pm +++ b/Debian/Debhelper/Buildsystem.pm @@ -169,7 +169,7 @@ sub canonpath { my ($this, $path)=@_; my @canon; my $back=0; - for my $comp (split(m%/+%, $path)) { + foreach my $comp (split(m%/+%, $path)) { if ($comp eq '.') { next; } diff --git a/Debian/Debhelper/Dh_Buildsystems.pm b/Debian/Debhelper/Dh_Buildsystems.pm index 8470eac0..f6c123c5 100644 --- a/Debian/Debhelper/Dh_Buildsystems.pm +++ b/Debian/Debhelper/Dh_Buildsystems.pm @@ -62,7 +62,7 @@ sub autoselect_buildsystem { my $selected; my $selected_level = 0; - for my $inst (@_) { + foreach my $inst (@_) { # Only derived (i.e. more specific) build system can be # considered beyond the currently selected one. next if defined $selected && !$inst->isa(ref $selected); @@ -92,7 +92,7 @@ sub load_buildsystem { else { # Try to determine build system automatically my @buildsystems; - for $system (@BUILDSYSTEMS) { + foreach $system (@BUILDSYSTEMS) { push @buildsystems, create_buildsystem_instance($system, @_); } return autoselect_buildsystem($step, @buildsystems); @@ -103,10 +103,10 @@ sub load_all_buildsystems { my $incs=shift || \@INC; my (%buildsystems, @buildsystems); - for my $inc (@$incs) { + foreach my $inc (@$incs) { my $path = File::Spec->catdir($inc, "Debian/Debhelper/Buildsystem"); if (-d $path) { - for my $module_path (glob "$path/*.pm") { + foreach my $module_path (glob "$path/*.pm") { my $name = basename($module_path); $name =~ s/\.pm$//; next if exists $buildsystems{$name}; @@ -116,7 +116,7 @@ sub load_all_buildsystems { } # Standard debhelper build systems first - for my $name (@BUILDSYSTEMS) { + foreach my $name (@BUILDSYSTEMS) { error("standard debhelper build system '$name' could not be found/loaded") if not exists $buildsystems{$name}; push @buildsystems, $buildsystems{$name}; @@ -124,7 +124,7 @@ sub load_all_buildsystems { } # The rest are 3rd party build systems - for my $name (keys %buildsystems) { + foreach my $name (keys %buildsystems) { my $inst = $buildsystems{$name}; $inst->{thirdparty} = 1; push @buildsystems, $inst; @@ -188,7 +188,7 @@ sub buildsystems_list { my $specified; # List build systems (including auto and specified status) - for my $inst (@buildsystems) { + foreach my $inst (@buildsystems) { if (! defined $specified && defined $opt_buildsys && $opt_buildsys eq $inst->NAME()) { $specified = $inst; } diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index c5b06f69..a4e35709 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -576,7 +576,7 @@ sub filedoublearray { # as if we were in the specified directory, so the # filenames that come out are relative to it. if (defined $globdir && ! compat(2)) { - for (map { glob "$globdir/$_" } split) { + foreach (map { glob "$globdir/$_" } split) { s#^$globdir/##; push @line, $_; } |