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

Ok, me again. To review, I installed Perl 5.6.0 on a Cobalt RaQ2. Seems to be working. But the Cobalt has some libraries that it's not finding now. They're at /usr/lib/perl5/site_perl/Cobalt and that doesn't seem to be a path in @INC. How can I modify the @INC to include the Cobalt package?

Current errors from Cron read like so:

Can't locate Cobalt/Monitor.pm in @INC (@INC contains: /usr/local/lib/perl5/5.6.0/mips-linux /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/mips-linux /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) + at /usr/local/sbin/monitor line 31. BEGIN failed--compilation aborted at /usr/local/sbin/monitor line 31.
Any help apreciated as always.

Replies are listed 'Best First'.
Re: @INC
by chromatic (Archbishop) on May 02, 2000 at 07:43 UTC
    There are at least three ways I can think of. You could push the appropriate directory onto @INC in a BEGIN block, so compilation won't fail:
    BEGIN { push @INC, "/usr/lib/perl5/site_perl/Cobalt"; }
    You can use the -I switch in your hashbang line: #!/usr/bin/perl -w -I/usr/lib/perl5/site_perl/Cobalt My favorite is the use lib syntax: use lib "/usr/lib/perl5/site_perl/Cobalt"; The Perl faq says you can also modify the PERLLIB or PERL5LIB environmental variables. Check your .profile or .blahrc files there.
Re: @INC
by perlmonkey (Hermit) on May 02, 2000 at 08:35 UTC
    Since you seem to be on a unix workstation the easiest way to do this without editing your existing programs is to just link your old directory into the current INC path. ln -s /usr/lib/perl5/site_perl/Cobalt /usr/local/lib/perl5/site_perl/Cobalt So now perl will find it under /usr/local/lib/perl5/site_perl

    I think you could also recompile perl and specify the default links paths to include /usr/lib/perl5/site_perl. I have not done it, so that is a guess.

    If their is an easier way I am not aware of it.
      I think you could also recompile perl and specify the default links paths to include /usr/lib/perl5/site_perl. I have not done it, so that is a guess.

      Supposedly, you can use the otherlibdirs Configure variable to push whatever you like onto @INC when you compile perl, but I haven't been able to get that to work.

      You can, however, use the "vendor-supplied add-ons" fields--vendorlib and vendorarch--for this purpose. Check out the INSTALL doc.