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

Hi,
module is there in the path of @INC directory. But still getting the error
"Can't locate loadable object for module PLSTAF in @INC "
/export/home/inmabisa/bin> ls *.pm* PLSTAF.pm PLSTAFService.pm STAFLog.pm STAFMon.pm
Here the PLSTAF.pm is present
/export/home/bin> perl -e "use PLSTAF;" Can't locate loadable object for module PLSTAF in @INC (@INC contains: + /export/home/bin /export/home/STAF /usr/perl5/5.8.4/lib/sun4-solaris +-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/sun4-solaris-6 +4int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendo +r_perl/5.8.4/sun4-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/per +l5/vendor_perl .) at -e line 1 Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. /export/home/bin>
But it couldn't find the module though it is in @INC Please let me know the solution. Thanks

Replies are listed 'Best First'.
Re: Not able to load module though @INC contains it
by bellaire (Hermit) on Nov 30, 2009 at 14:02 UTC
    Unless my eyes are playing tricks on me, it looks like you don't have that path in @INC after all.
    (@INC contains: /export/home/bin ... ) ^^^
    However your listing shows:
    /export/home/inmabisa/bin> ls *.pm* ^^^
      Please forget about 'inmabisa'. I edited it.
        You edited what? ... In any event, it seems the problem is with your loadable module, not with @INC. So it's not terribly relevant, but having misleading information in the data you provided is certainly distracting.
Re: Not able to load module though @INC contains it
by almut (Canon) on Nov 30, 2009 at 13:32 UTC

    A 'loadable object for module' denotes the shared object that non-pure-Perl modules require, not the .pm file. Presumably, you copied just the Perl file without also copying the associated shared object (.so) file — i.e. the module isn't installed properly.

      The lib folder contains associated .so file. Is it has to do something with DynLoader?
Re: Not able to load module though @INC contains it
by keszler (Priest) on Nov 30, 2009 at 13:28 UTC
      No. lib folder contains libPLSTAF.so
Re: Not able to load module though @INC contains it
by maheshvshet (Initiate) on Nov 30, 2009 at 14:15 UTC
    Hi,

    The problem coluld be that the STAF variable list is not updated. If Staf is in folder /usr/local/staf then PLSTAF.pm file will be in /usr/local/staf/bin folder. To get rid of the error set PERLLIB to point to /usr/local/staf/bin and then restart staf.

    After this step verify if staf variable list has PERLLIB with /usr/local/staf/bin included in it.

    To stop staf use: staf local shutdown shutdown

    To restart Staf use(in background): STAFProc &

    To verify the variable list use: staf local var list.

    Hope this helps.

    Regards

    Mahesh V.Shet

      No use. OS is Solaris 5.10 Is it PERLLIB or PERL5LIB? btw, do you use STAF in production?