4 ms·
It doesn't just have it for backwards compatibility, it's still a very useful feature in some cases: sub foo { local $ENV{HOME} = "/foo/bar";
by avar 16y ago
It doesn't just have it for backwards compatibility, it's still a very useful feature in some cases:
sub foo {
local $ENV{HOME} = "/foo/bar";
Code::I::Don't::Own();
}
foo();
Having dynamic scope here ensures that the foreign code will use the environment I want without me having to alter it.