At 05:08 PM 4/24/2001, you wrote:
>I had a pm that used to be working and is called using "use ABC::Test;".  I
>deleted (for some stupid reasons) the perl directory and didn't realize I
>also deleted the ABC subdirectory below site\lib.  I took another copy from
>another machine and placed it back under site\lib but now I'm getting this
>error message when I try to do "use ABC::Test;" - on Perl 5.  Any ideas?
>
>Can't locate loadable object for module ABC::Test in @INC (@INC contains:
>c:/perl/lib c:/perl/site/lib .) at - line 1

There's more to this module than just Perl code.  You need to look in 
/perl/site/lib/auto, and look for ABC/test there.  Copy all that stuff to 
the same path on the other machine, and you should be good to go.

Perl is in this case looking for an external .dll that implements some 
functionality of ABC::Test, and if it can't load that .dll at compile time, 
it won't have the code to run at runtime, so it prudently dumps you 
out.  That 'loadable object' part tells you it's looking for something 
compiled, not plain Perl.  The auto directory described above is where all 
this kind of compiled code is stored so that DynaLoader or something can 
find it when it needs it.  (XS gurus - It is DynaLoader that loads these 
libs, right?)

Check out perlmod, perlmodlib, and perlmodinstall for the gory 
details.   You may also need to drop in on perlxstut, and perlxs for all 
the info.  That's where things get really gory.  Oops... no that would be 
perlguts.  : )  And you might need to read that too.

Oh, just FYI, when Perl needs to call into an external library, .dll or .so 
or whatever you system calls them, it's done through a mechanism called XS, 
for eXternal Subroutines, or sometimes XSUBs.  These XSUBs are kinda hairy 
to write, unless you are a relatively accomplished C programmer, and have a 
good knowledge of how Perl internally handles data structures and 
operations.  If you saw Paul's post mentioning Inline.pm, it's job is to 
make it much simpler to write XSUBs.

And after what I said to Paul, I feel like a total tool mentioning both 
Inline and XS in the same post on a "beginners" mailing list.  Somebody 
rein me in!  : )

Thank you for your time,

Sean.

Reply via email to