in reply to 'local' for imported variables doesn't work as expected
I have solved the issue by changing
toour @EXPORT = qw( %debug $d_area dsay );
in Dsay.pm.our @EXPORT = qw( %debug *d_area dsay );
I now can use debugging code like
without the need of qualifying $Dsay::d_area anymore.sub one { local $d_area = "one"; dsay "debugging output from one"; }
Debugging output for the specified area stops as soon as the localized $d_area value drops out of scope.
This is exactly what I wanted.
|
---|