From fea76a11bc3673bc6fb523cffd8c325982bf44f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 6 Oct 2008 16:10:47 -0400 Subject: remove: Avoid $_ breakage. (Stupid, stupid perl.) This avoids another one of those $_ scoping issues where a deep call to a function that changes $_ clobbers the array that is being looped over. --- IkiWiki/Plugin/remove.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index cf95026c8..68bf9d1ee 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -98,7 +98,9 @@ sub removal_confirm ($$@) { #{{{ my $attachment=shift; my @pages=@_; - check_canremove($_, $q, $session) foreach @pages; + foreach my $page (@pages) { + check_canremove($page, $q, $session); + } # Save current form state to allow returning to it later # without losing any edits. -- cgit v1.2.3