Win32::OLE Can't locate loadable object

I have installed active perl 5.10.0.1002. It uses the win32::Ole module. But when I execute my script gives me the following error Can't locate loadable object for module Win32::OLE in @INC (@INC contains: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/
ygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8. Please advise.
saibskAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fishadrCommented:
Have you restarted since installing?

Also - make sure that the ole.pm module is in the \site\lib\win32\ directory

If all else fails run 5.6.1 seems to be a lot more usable!

http://downloads.activestate.com/ActivePerl/Windows/5.6/
0
Adam314Commented:
It looks as if you are running under cygwin.  Is this correct?  
Do you have the Win32::OLE module installed?  Where is it installed?  What directory in cygwin maps to that directory?
0
mjcoyneCommented:
I suspect it has something to do with the fact that all of your @INC pathways are pointing to your Perl 5.8 installation.

You can add the Perl 5.10 installation to the @INC array by adding either:

unshift(@INC, '/path/to/your/5.10/install');

or

use lib "/path/to/your/5.10/install";

to the beginning of your script, before the 'use' line for the troublesome module.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

mjcoyneCommented:
Further, as you can see from a related module (see http://cpan.uwinnipeg.ca/htdocs/libwin32/Win32/Lite.pm.html), I believe it's likely looking for a file named 'OLE.dll'.  So, you might find that file on your system, and include its path in @INC to see if the problem goes away...
0
saibskAuthor Commented:
Actually my script uses scp and when I try to run it from command prompt it gives me error as it doesn't recognize scp. SO i used cygwin. Initially cygwin was not able to find the OLE module. I copied it from C:\Perl where the Perl is installed to C:\cygwin\lib\perl5\5.8.

Then it started giving me this error Can't locate loadable object for module Win32::OLE

I tried using the use lib "C:/Perl"doesn't help. The location of the OLE.dll is C:\Perl\site\lib\auto\Win32\OLE. Not sure what to do
0
Adam314Commented:
Why are you using cygwin?  If you just want scp, you can install a version of scp on windows.
When you run perl -v from a cygwin prompt, what do you get?  When you run perl -v from a windows command prompt, what do you get?
0
saibskAuthor Commented:
How do I do scp on windows? I actually don't want to use cygwin but I am not sure how to do scp from cmd.

This is the code currently being used for scp

@args = ("scp", "StaticData.csv", "opt/TL/var/cfg/StaticData.csv");
system( @args) == 0
      or die "system @args failed: $?";

Please advise.
0
saibskAuthor Commented:
I already have winscp on my machine. could I use that?
0
Adam314Commented:
I didn't see a command line option for scp on the WinSCP page.  If you know of one that works, then you can use it.
Otherwise, you can use the Net::SCP module.
Instead of making a system call, you would call the scp funtion:

use Net::SCP 'scp';

scp("StaticData.csv", "opt/TL/var/cfg/StaticData.csv");


From these arguments, it looks like you should be able to use regular copy though...
0
saibskAuthor Commented:
I don't have perms to install the module. Could I use cygwin instead?

If I do perl -v on cygwin prints this:
This is perl, v5.8.8 built for cygwin-thread-multi-64int
(with 8 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


if I do perl -v on cmd I get

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 638 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Apr 13 2004 19:24:21

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.



If I have to copy the OLE.dll where should I put it? Please advise.
0
mjcoyneCommented:
Have you tried adding C:\Perl\site\lib\auto\Win32\OLE to @INC?  This directory is not in the @INC output you provided, it is where OLE.dll resides, and the script can't find OLE.dll.  Maybe if you add this directory to @INC by one of the methods I provided, the script will find this file and stop complaining?
0
Adam314Commented:
From within cygwin, I think that directory would be /cygdrive/c/perl/site/lib/auto/Win32/OLE.  You can add it using mjcoyne's instructions.
0
saibskAuthor Commented:
I need to provide the location of OLE.dll location right. It is located in C:\Perl\site\lib\auto\Win32\OLE. I tried both the methods


unshift(@INC, 'C:/Perl/site/lib/auto/Win32/OLE');

or

use lib "C:/Perl/site/lib/auto/Win32/OLE" still gives the same error.
0
Adam314Commented:
If the code is in cygwin, you can't use windows style path names.  Try this:
use lib '/cygdrive/c/Perl/site/lib/auto/Win32/OLE';
use Win32::OLE
0
saibskAuthor Commented:
This is the error I am getting:

Can't locate loadable object for module Win32::OLE in @INC (@INC contains: /cygd
rive/c/Perl/site/lib/auto/Win32/OLE /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8
 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5
/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 .) at /usr/lib/perl5/5.8/
OLE.pm line 23
Compilation failed in require at /usr/lib/perl5/5.8/OLE.pm line 23.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.8/OLE.pm line 23.
Compilation failed in require at AccountMappingXL.pl line 31.
BEGIN failed--compilation aborted at AccountMappingXL.pl line 31.

Line 31 in AccountMappingXL.pl
is use OLE.

Please advise.
0
Adam314Commented:
Where is OLE.pm
Is there more than one OLE.pm on your computer?
From a cygwin prompt: find / -name OLE.pm
0
saibskAuthor Commented:
find: File system loop detected; `/cygdrive/c/cygwin' is part of the same file system loop as `/'.

And the system hangs after this.
0
saibskAuthor Commented:
prints this

/cygdrive/c/Perl/lib/OLE.pm
/cygdrive/c/Perl/lib/Win32/OLE.pm

and hangs after that













0
Adam314Commented:
Try this:

use lib '/cygdrive/c/perl/lib';
0
saibskAuthor Commented:
I used the above gives me this error

$ perl AccountMappingXL.pl -d "."
Bareword "Internals::inc_sub_generation" not allowed while "strict subs" in use
at /cygdrive/c/Perl/lib/constant.pm line 112.
Compilation failed in require at /cygdrive/c/Perl/lib/Getopt/Long.pm line 226.
BEGIN failed--compilation aborted at /cygdrive/c/Perl/lib/Getopt/Long.pm line 22
6.
Compilation failed in require at AccountMappingXL.pl line 30.
BEGIN failed--compilation aborted at AccountMappingXL.pl line 30.
0
Adam314Commented:
I think the problem is the cygwin version of perl using the standard windows version libraries.

Try installing all of the needed libraries in cygwin.
    perl -MCPAN -e "install Win32::OLE"

You might need to have the cygwin compiler installed.  If it isn't, try installing it.


What is preventing you from installing the Net::SCP module, and just using the ActiveState distribution from windows?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mjcoyneCommented:
Why can't you use ActiveState's Perl for Windows?  Must you use Cygwin?
0
mjcoyneCommented:
Oops -- just noticed Adam asked the same thing...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.