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

Howdy folks.

I'm having fits. My perl script uses another module, and I
have to make sure it knows where to look for the module.

The module is located on
/opt/ipcwww/data/lab/tcreports/ims/bin

In the called script, I've tried
use lib '/opt/ipcwww/data/lab/tcreports/ims/bin'; use MyModule

I've even tried
require '/opt/ipcwww/data/lab/tcreports/ims/bin/MyModule.pm';
To no avail. Can anyone help me?

print ((split '', 'just another perl hacker' )[-1,0,10]);

Replies are listed 'Best First'.
Re: use lib 'foo/bar' in cron-called script...
by Abigail-II (Bishop) on Jun 06, 2002 at 16:37 UTC
    Are you sure it is there? Are you sure the UID under which the cron job runs can read the file? What error are you getting? What happens if you make a simple perl program that opens the .pm file and reads its content and you run that from cron?

    Abigail

      And make sure that every dir in the path is a+x or g+x if you are sharing a group with the UID of the cron job.
Re: use lib 'foo/bar' in cron-called script...
by talexb (Chancellor) on Jun 06, 2002 at 17:00 UTC
    Don't forget you can always include
    PERL5LIB=/home/fininfo/perllib: ...
    in your crontab definition. I've found that very useful for the jobs I run.

    --t. alex

    "Nyahhh (munch, munch) What's up, Doc?" --Bugs Bunny

Re: use lib 'foo/bar' in cron-called script...
by JayBonci (Curate) on Jun 06, 2002 at 20:08 UTC
    Have your script try to open the file. Then it will know what error the perl library loader is seeing:
    open MYLIBRARY,"/opt/ipcwww/data/lab/tcreports/ims/bin" or die "Ack, f +ile trouble: $!";
    Hopefully that will let you know whether it's a permission problem, or a library path problem ($! should tell you what's going down). Good luck.

        --jb
      Thank you. This was a good suggestion.

      What I've actually done is something that Abigail-II
      suggested: I'm running the scripts from my own crontab,
      thus bypassing my co-worker's crontab woes. This actually
      makes more sense anyhow, since I own the perl files.

      Anyhow, from my own crontab things run just fine.
      Permissions and paths all appear to be fine... at least
      I'm getting the expected output now.

      -Rob
      (maybe I'm not even at the user-level of proficiency, eh?)
      (it's been one of those weeks)