Brajen259 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, When i try to run a script i get the error like "cant locate a module". I saw the module was present so exported the variable and it worked . But when i tried to make the changes permanently i got the same error. After investigation I found the following things . 1. We had a user (lets say X) , @INC was having a path which also contains part of home directory (like /home/x/.../) 2. we removed the user X and we have user Y now . 3. Still the @INC is looking for the previous path which does not exist. any suggestions would be appreciated . Thanks, Brajen

Replies are listed 'Best First'.
Re: Not able to remove path from @INC
by Anonymous Monk on Jan 28, 2014 at 16:56 UTC
Re: Not able to remove path from @INC
by Brajen259 (Initiate) on Jan 29, 2014 at 13:03 UTC
    Actually, I dont want to add anything . There are some default paths that @INC looking during run time . These paths are already removed . when I try to update the @INC using lib modules , it is throwing me a error like Config.pm is not available. any solutions please. Thanks in advance Brajen

      You will need to show the relevant code that produces the problem.

      One easy way of producing what you seem to describe would be something like the following:

      BEGIN { @INC= (); }; use lib '/home/foo/perl-lib'; # will die with "module lib.pm not found +"

      My advice is to just not do that, or to review require, which allows runtime loading of files.