in reply to Re: Configuring default @INC
in thread Configuring default @INC

https://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=grep&s=DEFAULT_INC_EXCLUDES_DOT

Replies are listed 'Best First'.
Re^3: Configuring default @INC
by Thopilt (Initiate) on Mar 01, 2017 at 02:40 UTC
    Oh, well, that sucks. Have to go to the source code and even then only in the very latest development version. At least I know now, thanks for the link.

      If you can muster the patience to wait until May 2017, it's highly likely that the feature to exclude the current directory from @INC will have made it into 5.26, which is set to be released then.

      Oh, well, that sucks. Have to go to the source code and even then only in the very latest development version. At least I know now, thanks for the link.

      Well, you can always turn on taint, which will remove . from @INC, but most code isn't prepared to deal with taint so ...

      Well, you don't have to go to the source in the latest version, its a configuration option, you just gotta configure the configuration

      For arbitrary older versions, all you do is "backport" from the current version, which all it really is applying a patch, which you produce from the current dev version ... but thats only if you want to have a configuration option like the latest version

      Removing "." from @INC can be as simple grepping the source (perl.c) and commenting out   S_incpush(aTHX_ STR_WITH_LEN("."), 0);

        you don't have to go to the source in the latest version, its a configuration option, you just gotta configure the configuration

        Indeed, -Ddefault_inc_excludes_dot does it for me with latest devel release (perl-5.25.10) on Ubuntu.
        The test suite passed all tests.

        As Corion has already indicated, you probably won't have to provide that config option with 5.26.0.

        Cheers,
        Rob