A very, very important question:
- Do you have Strawberry Perl, or
- Do you have ActivePerl?
If you have Strawberry Perl, you will use a command line utility called cpan. For people who are use to GUIs, this can be a wee bit intimidating. First you have to run it, so it can configure itself. Much of the configuration is pretty automatic, and you can simply accept the defaults.
Once it's configured, you may have to run cpan
a second time. The *.pm
suffix stands for Perl Module, and you have to install the missing Perl module. Let's look at your error message once again:
Win32::OLE operating in debugging mode: _Unique => 1 at
C:/strawberry/perl/vendor/lib/Win32/OLE/Lite.pm line 30. require Win32/OLE/Lite.pm called at C:/strawberry/perl/vendor/lib/Win32/OLE.pm line 48 require Win32/OLE.pm called at C:\Users\c_desaik\Desktop\pwrdb\offtarget\pwrdb.pl line 37 main::BEGIN() called at C:/strawberry/perl/vendor/lib/Win32/OLE/Lite.pm line 0 eval {...} called at C:/strawberry/perl/vendor/lib/Win32/OLE/Lite.pm line 0 main:: (C:\Users\c_desaik\Desktop\pwrdb\offtarget\pwrdb.pl:53): 53: my $prod_id = `"QPSTAtmnServer.Application";
According to this, you're missing two modules: One is called Win32::OLE::Lite
(from Win32/OLE/Lite.pm
) and another Win32::OLE
(from Win32/OLE
)
You can go to http://search.cpan.com, type Win32::OLE::Lite
into the search box, and you get the Win32::OLE CPAN page explaining how to use this module. It turns out Win32::OLE::Lite
is a sub-module that's included in this module. You never address it separately.
In turn, it is likely that this module may depend upon other modules which can depend upon other modules. Don't worry, CPAN will take care of all the dependencies issues.
Now, to install this module, just type in the following command:
C:\> cpan install Win32::OLE
CPAN will chug away filling your screen with pages of output. Read it as it goes zooming by and commit it to memory because every word is absolutely important to remember. Okay, maybe not. However, I suggest you change the Windows Command Prompt Terminal Screen Buffer Height from 300 lines to 9999 lines incase there is something important.
When you do this, you'll see this:
CPAN: CPAN::SQLite loaded ok (v0.202)
CPAN: LWP::UserAgent loaded ok (v6.04)
CPAN: Time::HiRes loaded ok (v1.9725)
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
CPAN: YAML::XS loaded ok (v0.38)
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Database was generated on Tue, 10 Sep 2013 19:27:08 GMT
Updating database file ...
And on and on...
You'll get warnings galore:
OLE.xs:5674:68: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
OLE.xs:5676:67: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
OLE.xs:5678:70: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
OLE.xs:5680:71: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
OLE.xs:5683:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
....
That's par for the course. As long as you don't see the dreaded word error, you're okay.
After compiling, you'll see a bunch of tests:
C:\perl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/1_nls.t ....... ok
t/2_variant.t ... ok
t/3_ole.t ....... ok
t/4_compat.t .... ok
t/5_unicode.t ... skipped: Unicode::String module not installed
t/6_event.t ..... ok
t/7_overload.t .. ok
ok
and skipped
are fine. With luck, you'll see:
All tests successful.
Files=7, Tests=112, 241 wallclock secs ( 0.09 usr + 0.03 sys = 0.13 CPU)
Next, comes the install, and you're done.
Type:
C:\> perldoc Win32::OLE
And, that should give you the Perl Doc on that module if that module is installed.
Now, run your program, and hope everything works.