develooper Front page | perl.perl5.porters | Postings from August 2016

Alternative Fix for dot-in-INC mechanic.

Thread Next
Kent Fredric
August 14, 2016 21:34
Alternative Fix for dot-in-INC mechanic.
Message ID:
I'm just relaying the contents of:

Because I would be loath if 5.23.3 and 5.24.1 shipped without at least
ensuring this properly considered.

The essential issue is that by localising @INC in, any changes
made to @INC by the module being loaded are lost.

And so instead of assuming @INC can be simply reverted to its previous
state, it uses a scope guard, and thus tries to effectively localise
*only* the absense of '.' by:

a) only adding cleanup logic if $INC[-1]  is in fact '.'
b) reinserting '.' in the cleanup block on base->import scope exit.

Presently, localising is done regardless of the presence of a ".",
making any @INC modification in impossible, even if the user
had already removed '.' themselves.

There is other feedback on
potentially worth considering.

Though the contents of the patch are submitted here verbatim as an
attachment for P5P's convenience.



Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About