From 1e17ea0b65e4f296e0e53116be5d5e692b81b2af Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 6 Oct 2008 16:19:54 -0400 Subject: [PATCH 1/1] avoid $_ in a few other for loops These were probably not currently buggy, but let's avoid bugs being introduced by the functions called clobbering $_. --- IkiWiki/Plugin/autoindex.pm | 4 +++- IkiWiki/Plugin/goodstuff.pm | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm index a79a06314..d1b3edb1f 100644 --- a/IkiWiki/Plugin/autoindex.pm +++ b/IkiWiki/Plugin/autoindex.pm @@ -97,7 +97,9 @@ sub refresh () { #{{{ if ($config{rcs}) { IkiWiki::disable_commit_hook(); } - genindex($_) foreach @needed; + foreach my $page (@needed) { + genindex($page); + } if ($config{rcs}) { IkiWiki::rcs_commit_staged( gettext("automatic index generation"), diff --git a/IkiWiki/Plugin/goodstuff.pm b/IkiWiki/Plugin/goodstuff.pm index 08ed960b4..ed1f4ddfc 100644 --- a/IkiWiki/Plugin/goodstuff.pm +++ b/IkiWiki/Plugin/goodstuff.pm @@ -27,7 +27,9 @@ my @bundle=qw{ sub import { #{{{ hook(type => "getsetup", id => "goodstuff", call => \&getsetup); - IkiWiki::loadplugin($_) foreach @bundle; + foreach my $plugin (@bundle) { + IkiWiki::loadplugin($plugin); + } } # }}} sub getsetup { #{{{ -- 2.44.0