metadata perl scrip...
 
Notifications
Clear all

metadata perl script

8 Posts
3 Users
0 Likes
580 Views
(@strobak)
Posts: 35
Eminent Member
Topic starter
 

I recently bought keydet89's book, which is excellent, but i can't get one of the PERL scripts "wmd.pl" to run.

I've downloaded the OLEStorage and OLEMap modules and put them in the c\perl\lib directory on my machine but when i try to run the script from the command prompt by navigating to the perl directory and typing

perl wmd.pl c\test.doc

i get the message

"Can't locate OLE/Storage.pm in @INC <@INC contains c/Perl/site/lib c/Perl/site/lib.> at wmd.pl line 16.
"BEGIN failed–compilation aborted at wmd.pl line 16."

I'm guessing i am not storing these modules in the correct directory?
or that i am not typing the write command?
or that i need an additional module?

Thanks

 
Posted : 10/12/2007 4:34 pm
azrael
(@azrael)
Posts: 656
Honorable Member
 

I'm guessing i am not storing these modules in the correct directory?

Spot on there -)

You can fix this two ways

(1) Move the modules to where Perl is looking ( c/Perl/site/lib - @INC is the path that modules are searched for in ).

(2) Extend @INC to include the path that the modules _are_ installed in … As with most Perl, there are about a dozen different ways of doing this. Google is a friend, but for starters, on the command line try


perl -I c\path\to\the\library wmd.pl c\test.doc

so for example the following


perl -I "C/Documents and Settings" -le "print for @INC"

Adds the directory "Documents and Settings" to the path and then prints out each of the @INC contents …


C/Documents and Settings
C/data/wre/prereqs/perl/lib
C/data/wre/prereqs/perl/site/lib
.

Note the . at the end, Perl will always try the current directory as well …

Hope this helps -)

 
Posted : 10/12/2007 5:31 pm
(@strobak)
Posts: 35
Eminent Member
Topic starter
 

azrael,

thanks for the reply, unfortunately it didn't help, i've tried both your suggestions and for some reason it just won't work.

?? (

 
Posted : 10/12/2007 6:19 pm
keydet89
(@keydet89)
Posts: 3568
Famed Member
 

I recently bought keydet89's book, which is excellent, but i can't get one of the PERL scripts "wmd.pl" to run.

I've downloaded the OLEStorage and OLEMap modules and put them in the c\perl\lib directory on my machine but when i try to run the script from the command prompt by navigating to the perl directory and typing

perl wmd.pl c\test.doc

i get the message

"Can't locate OLE/Storage.pm in @INC &lt;@INC contains c/Perl/site/lib c/Perl/site/lib.&gt; at wmd.pl line 16.
"BEGIN failed–compilation aborted at wmd.pl line 16."

I'm guessing i am not storing these modules in the correct directory?
or that i am not typing the write command?
or that i need an additional module?

A couple of ideas…

1. Try contacting the author directly…he might be able to help.

2. What version of Perl are you using?

3. Based on what you've said, the Storage.pm file is located in the c\perl\lib dir, which is probably why the Perl interpreter can't find it. *If* you're using ActiveState Perl, you can very easily use the 'ppm' tool to take care of the installation of the necessary Perl modules, such as

c\perl>ppm install ole-storage

Hope that helps,

H

 
Posted : 10/12/2007 7:38 pm
azrael
(@azrael)
Posts: 656
Honorable Member
 

azrael,

thanks for the reply, unfortunately it didn't help, i've tried both your suggestions and for some reason it just won't work.

?? (

If you don't get any further after Harlan's hints, could you provide more information. For example

Same error message or different ?

Thanks,

Si

 
Posted : 10/12/2007 7:50 pm
(@strobak)
Posts: 35
Eminent Member
Topic starter
 

that did let me download ole-storage.pm and map.pm and put them into the c\perl\site\lib directory but i still get an error

"Can't locate startup.pm in @INC <@INC contains C/Perl/site/lib C/Perl/site/lib.> at C\Perl\wmd.pl line 18.
BEGIN failed–compilation aborted at C\Perl\wmd.pl line 18."

other suggestions??

thanks a lot

 
Posted : 10/12/2007 8:03 pm
azrael
(@azrael)
Posts: 656
Honorable Member
 

Fair enough - you now seem to be missing a different module that is expected.

startup.pm …

You need to get this one into the path as well ….

 
Posted : 10/12/2007 8:32 pm
keydet89
(@keydet89)
Posts: 3568
Famed Member
 

that did let me download ole-storage.pm and map.pm and put them into the c\perl\site\lib directory but i still get an error

I think another part of the issue here is communicating the issue at hand…'ppm' doesn't let you "download the modules and put them" in any directory. It takes care of the installation for you…you actually downloading the modules yourself have connotations of something entirely different.

"Can't locate startup.pm in @INC &lt;@INC contains C/Perl/site/lib C/Perl/site/lib.&gt; at C\Perl\wmd.pl line 18.
BEGIN failed–compilation aborted at C\Perl\wmd.pl line 18."

other suggestions??

After this, I'm completely at a loss to understand why you didn't simply do the most logical thing

c\perl>ppm install startup

Hope that helps…

H

 
Posted : 11/12/2007 4:16 am
Share: