in reply to Re: Can't locate Modules/test.pm in @INC
in thread Can't locate Modules/test.pm in @INC

Hi I tried both the options.
When I included the use lib $ENV{ SOURCE_ROOT }; in .pl fine nothig changed, i got the same error again.
And on trying the second option I was not able to locate the PERL5LIB env variable so created one and when i appended the $SOURCE_ROOT following error i got:
login-linux-hyd-001{67}> which perl
/pkg/perl/5.8/bin/perl
login-linux-hyd-001{68}> setenv
PERL5LIB /pkg/perl/5.8/bin/perl
login-linux-hyd-001{69}> setenv PERL5LIB
$SOURCE_ROOT:$PERL5LIB
Bad : modifier in $ ($).
login-linux-hyd-001{70}> setenv PERL5LIB
$SOURCE_ROOT:$PERL5LIB Bad : modifier in $ ($).
login-linux-hyd-001{71}> setenv PERL5LIB
SOURCE_ROOT:$PERL5LIB
login-linux-hyd-001{72}> echo $PERL5LIB
SOURCE_ROOT:/pkg/perl/5.8/bin/perl
login-linux-hyd-001{73}> setenv PERL5LIB
$SOURCE_ROOT:/pkg/perl/5.8/bin/perl
Bad : modifier in $ (/).
  • Comment on Re^2: Can't locate Modules/test.pm in @INC

Replies are listed 'Best First'.
Re^3: Can't locate Modules/test.pm in @INC
by Anno (Deacon) on Feb 22, 2007 at 12:57 UTC
    The problem indicated by Bad : modifier in $ ($) is a problem with csh variable syntax. The colon has special significance if it follows a variable name. To isolate it, use {} around the variable name, much like in Perl. So
    setenv PERL5LIB ${SOURCE_ROOT}:$PERL5LIB
    should do what you want.

    However, the effort you are making to put (parts of) the original include path into $PERL5LIB is unnecessary. What you specify in $PERL5LIB is searched in addition to the original path. So, just

    setenv PERL5LIB $SOURCE_ROOT
    should be enough.

    Anno

Re^3: Can't locate Modules/test.pm in @INC
by Moron (Curate) on Feb 22, 2007 at 12:21 UTC
    Unfortunately, I only have access to a sunos system today and I can't reproduce the problem you are now having. However, the impression I get is that SOURCE_ROOT is not yet itself defined when you tried the above. Also, it is worth asking what shell you are using (try the ps command to find out).

    -M

    Free your mind