summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-01-29 13:46:37 +0000
committerSadie Powell <sadie@witchery.services>2021-01-29 13:46:37 +0000
commit2fceea41e8eefe0e109d7b7de445589bfd2a49ef (patch)
treef1f36f2d8c1440b17b9f600fcd17b2b9fe12b50c /make
parent3e557e85d3ae1ef6d09ed2fdda379d8833a4400d (diff)
Always use for in Perl modules.
Diffstat (limited to 'make')
-rwxr-xr-xmake/calcdep.pl2
-rw-r--r--make/configure.pm8
-rw-r--r--make/template/inspircd4
3 files changed, 7 insertions, 7 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 3c02024fa..ca6b2628c 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -90,7 +90,7 @@ END
push @core_deps, $out;
}
- foreach my $directory (qw(coremods modules)) {
+ for my $directory (qw(coremods modules)) {
opendir(my $moddir, $directory);
for my $file (sort readdir $moddir) {
next if $file =~ /^\./;
diff --git a/make/configure.pm b/make/configure.pm
index 86ce8d0a1..c044fd104 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -58,7 +58,7 @@ our @EXPORT = qw(CONFIGURE_CACHE_FILE
sub __get_socketengines {
my @socketengines;
- foreach (<${\CONFIGURE_ROOT}/src/socketengines/socketengine_*.cpp>) {
+ for (<${\CONFIGURE_ROOT}/src/socketengines/socketengine_*.cpp>) {
s/src\/socketengines\/socketengine_(\w+)\.cpp/$1/;
push @socketengines, $1;
}
@@ -261,7 +261,7 @@ sub get_compiler_info($) {
sub find_compiler {
my @compilers = qw(c++ g++ clang++ icpc);
- foreach my $compiler (shift // @compilers) {
+ for my $compiler (shift // @compilers) {
return $compiler if __test_compiler $compiler;
return "xcrun $compiler" if $^O eq 'darwin' && __test_compiler "xcrun $compiler";
}
@@ -276,7 +276,7 @@ sub parse_templates($$$) {
my %settings = __get_template_settings($config, $compiler, $version);
# Iterate through files in make/template.
- foreach my $template (<${\CONFIGURE_ROOT}/make/template/*>) {
+ for my $template (<${\CONFIGURE_ROOT}/make/template/*>) {
say console_format "Parsing <|GREEN ${\abs2rel $template, CONFIGURE_ROOT}|> ...";
open(my $fh, $template) or print_error "unable to read $template: $!";
my (@lines, $mode, @platforms, @targets);
@@ -343,7 +343,7 @@ sub parse_templates($$$) {
# Write the template file.
say console_format "Writing <|GREEN ${\abs2rel $target, CONFIGURE_ROOT}|> ...";
open(my $fh, '>', $target) or print_error "unable to write $target: $!";
- foreach (@lines) {
+ for (@lines) {
say $fh $_;
}
close $fh;
diff --git a/make/template/inspircd b/make/template/inspircd
index 4b316e0e0..70072df60 100644
--- a/make/template/inspircd
+++ b/make/template/inspircd
@@ -149,8 +149,8 @@ sub cmd_help()
my @cmds = grep /^cmd_/, @subs;
my @devs = grep /^dev_/, @subs;
local $_;
- $_ =~ s/^(cmd|dev)_// foreach (@cmds, @devs);
- $_ =~ s/_/-/g foreach (@cmds, @devs);
+ $_ =~ s/^(cmd|dev)_// for (@cmds, @devs);
+ $_ =~ s/_/-/g for (@cmds, @devs);
print STDERR "Usage: ./inspircd (" . join("|", @cmds) . ")\n";
print STDERR "Developer arguments: (" . join("|", @devs) . ")\n";
exit GENERIC_EXIT_SUCCESS;