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

I have created my own module and placed it in /home/kcella/lib but cannot get perl to find it. The path has been added to @INC, spellig is correct, the use statement is present and permissions are 755. What else could I be missing? Output from execution:
Can't locate Config/CronJob.pm in @INC (@INC contains: C:/cygwin/home/ +kcella/bin/../lib C:\Program Files\ActiveState Perl Dev Kit 6.0\lib\ +c:/Perl/site/lib c:/Perl/lib .) at C:\cygwin\home\kcella\bin\cronjobm +an.pl line 16. BEGIN failed--compilation aborted at C:\cygwin\home\kcella\bin\cronjob +man.pl line 16.
Output from ls on my module:
$ ls -l /home/kcella/lib/Config/CronJob/CronJob.pm -rwxr-xr-x 1 kcella None 1259 Jan 7 21:26 /home/kcella/lib/Config/Cro +nJob/CronJob.pm
Yes, I know I am using Activestate perl on cygwin. There is only one copy of the interpreter and I have already dealt with the issues for path conversion. Another odd thing, if I copy the module to c:/Perl/site/lib it works without any errors.

Replies are listed 'Best First'.
Re: Module present in @INC but not found
by bart (Canon) on Jan 19, 2007 at 12:54 UTC
    You seem to have a directory level too many in your module path. The file should have been put at /home/kcella/lib/Config/CronJob.pm, not /home/kcella/lib/Config/CronJob/CronJob.pm.
      Well now I feel silly. That was all it took. I had too many levels in my directory structure. Why in the world that did not occur to me is a mystery. Thanks!
Re: Module present in @INC but not found
by aspect_khaliq (Novice) on Jan 19, 2007 at 13:08 UTC
    The file should have been put at /home/kcella/lib/Config/CronJob.pm, or you could have been used your module this way

    use Config::CronJob::CronJob;
      If you do that, though, make sure the package declaration matches the module name, or you'll end up with very confusing results.

        The only one I can think of is if you use a different module name in a separate use or require statement. Did you have another in mind?

Re: Module present in @INC but not found
by f00li5h (Chaplain) on Jan 20, 2007 at 03:02 UTC

    Although you speak of a windows perl, that I've only installed, and never touched I would guess that perl is perl, and suggest

    sticking  use lib '/home/kcella/lib'; in your code

    or setting PERL5LIB or PERLLIB in the environment ...

    Like I say, I've not tried it, but it may be worth a look.

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
      home/kcella/lib is already in @INC
Re: Module present in @INC but not found
by Anonymous Monk on Jan 20, 2007 at 00:42 UTC