You should be able to scope that global with our
our %GLOBAL = {
dir1 => "/path/to/directory"
dir2 => "/path/to/another"
};
You will most likely have more errors to contend with that are not necessarily related. Just deal with them one at a time. (And check in your code each time you successfully remove a compilation error or warning.)
UPDATE!
Why is that hash holding a hash reference? It probably should be either
our %GLOBAL = (
dir1 => "/path/to/directory"
dir2 => "/path/to/another"
);
or
our $GLOBAL = {
dir1 => "/path/to/directory"
dir2 => "/path/to/another"
};
I sincerely hope that was a typo on your behalf, this looks to be a daunting piece of code to refactor.
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)