do not modify $_ in list functions. PBP/114
This commit is contained in:
parent
fc6cd26348
commit
be6b2d3e7c
1 changed files with 6 additions and 2 deletions
|
|
@ -9,8 +9,12 @@ our $HELP = {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $dir = join '/', $session->config->getWebguiRoot, "lib", "WebGUI", "Macro";
|
my $dir = join '/', $session->config->getWebguiRoot, "lib", "WebGUI", "Macro";
|
||||||
opendir( DIR, $dir ) or $session->errorHandler->fatal("Can't open Macro directory: $dir!");
|
opendir( DIR, $dir ) or $session->errorHandler->fatal("Can't open Macro directory: $dir!");
|
||||||
my @macros = map { s/\.pm//; $_; }
|
my @macros = ();
|
||||||
grep {/\.pm$/} readdir(DIR); ##list of namespaces
|
foreach my $dir (readdir(DIR)) {
|
||||||
|
next unless $dir =~ /\.pm$/;
|
||||||
|
$dir =~ s/\.pm//;
|
||||||
|
push @macros, $dir;
|
||||||
|
}
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
|
|
||||||
##Build list of enabled macros, by namespace, by reversing session hash:
|
##Build list of enabled macros, by namespace, by reversing session hash:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue