Mailing List Archive

no bug report, a warning: chdir $_
It seems, that chdir (or readdir) and $_ do not mix well.

I could probably prove it, but until now the problem only occurred in
very complex MakeMaker situations. Last time I saw the problem, it was
easily fixed by patching Cwd.pm. All I had to do was change a $_ in
Cwd.pm to a lexically scoped variable.

Today I saw the same problem with a 'chdir $_' which I had in
MakeMaker. The manifestation of the problem was that one array within
the Makefile object was considerably damaged. Only one array out of a
few hundreds.

Bear in mind: don't use $_ excessively in libraries especially not if
you are going to chdir somewhere.

Sorry, that I cannot submit a test case,
andreas