From be6b2d3e7cfa30123ae2f64ff52eff513895560a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 5 Dec 2007 23:00:58 +0000 Subject: [PATCH] do not modify $_ in list functions. PBP/114 --- lib/WebGUI/Help/Macros.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Help/Macros.pm b/lib/WebGUI/Help/Macros.pm index 791a8f5f0..f249683ec 100644 --- a/lib/WebGUI/Help/Macros.pm +++ b/lib/WebGUI/Help/Macros.pm @@ -9,8 +9,12 @@ our $HELP = { my $session = shift; my $dir = join '/', $session->config->getWebguiRoot, "lib", "WebGUI", "Macro"; opendir( DIR, $dir ) or $session->errorHandler->fatal("Can't open Macro directory: $dir!"); - my @macros = map { s/\.pm//; $_; } - grep {/\.pm$/} readdir(DIR); ##list of namespaces + my @macros = (); + foreach my $dir (readdir(DIR)) { + next unless $dir =~ /\.pm$/; + $dir =~ s/\.pm//; + push @macros, $dir; + } closedir(DIR); ##Build list of enabled macros, by namespace, by reversing session hash: