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

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.

Replies are listed 'Best First'.
Re^4: Configuring default @INC
by Corion (Patriarch) on Mar 01, 2017 at 08:29 UTC

    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.

Re^4: Configuring default @INC
by Anonymous Monk on Mar 01, 2017 at 04:01 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.

    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