in reply to Configuring default @INC

I mean perl -V shouldn't show it at the bottom

1) Create a file called (eg) no_dot.pm:
package no_dot; # Assuming that '.' is at the end of @INC # Otherwise amend code accordingly BEGIN{pop @INC}; 1;
2) Place no_dot.pm in your $INC[0] folder.
3)Set the environment variable PERL5OPT to -Mno_dot
4) Run perl -V and observe that the last @INC entry (which is '.' for me) no longer appears.
5) Clear PERL5OPT to return to original @INC.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Configuring default @INC
by Thopilt (Initiate) on Mar 01, 2017 at 02:38 UTC
    heh... just using -M-lib=. would be better, but I specifically said I didn't want to do that. Thanks anyway.
      just using -M-lib=. would be better, but I specifically said I didn't want to do that

      Yes, setting PERL5OPT to -M-lib=. is a simpler solution - and one that I hadn't really thought about.

      Cheers,
      Rob