Can't locate module in @INC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tsajuc
    New Member
    • Apr 2008
    • 1

    Can't locate module in @INC

    Hi,

    I am getting an error

    Can't locate Preref.pm in @INC (@INC contains: /appleng/stage/preref/bin/../.. /appleng/stage/preref/bin /usr/local/oracle/perl/5.8.1/lib /usr/local/oracle/perl/5.8.1/addon /usr/local/oracle/perl/addon /usr/local/git/perl-addon) at preref.pl line 37.

    where as in the script preref.pl I have added the path to Preref.pm in the following lines

    use FindBin qw($Bin);
    use lib qw($Bin/../.. $Bin);

    $Bin ( /appleng/stage/preref/bin ) contains Preref.pm
    $Bin/../.. contains other modules which I use.

    It is very surprising that the script works fine in /appleng/dev/preref/bin
    and the same script does not work at /appleng/stage/preref/bin


    Please help in identifying the cause of this error.


    Thanks and Regards,
    Saju
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    I would suggest that you hard code the following line rather than using a variable.

    [code=perl]use lib '/path/to/modules';[/code]
    --Kevin

    Comment

    Working...