in reply to Re^3: Strange Global Array issue
in thread Strange Global Array issue
The use of $_ in a foreach doesn't add much risk or cause much reduction in the robustness of the code. foreach, like map and grep, will always localize $_ within its scope.
There is only the slight risk of the function mucking with $_ (as the original poster's original function did); however, any function that uses or modifies a non-localized $_ is broken.
|
|---|