1

I want to set a path in @INC, as script is failing to locate perl module. Requirement is that , i cannot include the module path in the script directly. So , i am thinking to add module path directly in @INC. Is there a way i can do that.

I have tried to edit ~/.bash_profile , ~/.bashrc as well. But its not adding the path in @INC.

2

There are various ways:

  • call as perl -Ipath script.pl
  • call as PERL5OPT=path script.pl
  • globally set export PERL5OPT=path in .profile or PERL5OPT=path in .pam_environment (affects other scripts too)
0

I found the simple soultion of it.

push(@INC,/path) or unshift(@INC,'/path)

Second method : use lib "/path" in file itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.