Getting strange double-error messages on a "use <module>" - does notseem to be @INC problem

D

David Filmer

I'm trying to run someone else's code. I'm getting pairs of error
messages that look like this:

Compilation failed in require at /path/to/scripts/fooator.pl line
86.
BEGIN failed--compilation aborted at /path/to/scripts/fooator.pl
line 86.

Line 86 says:

use CPM::MainProc;

Well, I figure that I have a problem with that module not being found
in @INC, even though I'm accustomed to a different pair of error
messages ("Can't locate Foo.pm in @INC..." and the same "BEGIN failed"
message).

But, anyway, CPM::MainProc is at /path/to/scripts/perllib/CPM/
MainProc.pm, so I added (before line 86):

use lib( '/path/to/scripts/perllib' , '/path/to/scripts/perllib/
CPM' );

But it makes no difference.

FWIW, The first line of MainProc.pm is
package CPM::MainProc;

I'm thinking the problem has nothing to do with @INC. I don't know
what that "Compilation failed in require" message means.

Can anyone help?

Thanks!
 
U

Uri Guttman

DF> I'm trying to run someone else's code. I'm getting pairs of error
DF> messages that look like this:

DF> Compilation failed in require at /path/to/scripts/fooator.pl line
DF> 86.
DF> BEGIN failed--compilation aborted at /path/to/scripts/fooator.pl
DF> line 86.

DF> Line 86 says:

DF> use CPM::MainProc;

DF> Well, I figure that I have a problem with that module not being found
DF> in @INC, even though I'm accustomed to a different pair of error
DF> messages ("Can't locate Foo.pm in @INC..." and the same "BEGIN failed"
DF> message).

DF> But, anyway, CPM::MainProc is at /path/to/scripts/perllib/CPM/
DF> MainProc.pm, so I added (before line 86):

DF> use lib( '/path/to/scripts/perllib' , '/path/to/scripts/perllib/
DF> CPM' );

DF> But it makes no difference.

hi dave!

well, that is because it DID find the module. the error says the
compilation of CPM::MainProc failed. so run a perl -c on that module and
see what perl says. likely that module has a syntax error or possibly it
is missing the trailing 1; needed for require to return a true value.

uri
 
D

David Filmer

Hi, Uri - long time. I'm messing with some code from the Mother Ship.
well, that is because it DID find the module. Ah.

compilation of CPM::MainProc failed. so run a perl -c on that module

Hmmm. I get

Compilation failed in require at /path/to/scripts/perllib/CPM/
MainProc.pm line 214.
BEGIN failed--compilation aborted at /path/to/scripts/perllib/CPM/
MainProc.pm line 214.

OK, the module doesn't like itself. So I have a look at line 214:

use CPM;

Which I check:

perl -c /path/to/scripts/perllib/CPM.pm
/ProductMaker/scripts/perllib/CPM.pm syntax OK

FWIW, all the modules end in "1;"

Before, I felt like I was going in circles. Now I feel like I've hit
a brick wall.
 
D

David Filmer

Before, I felt like I was going in circles.  Now I feel like I've hit
a brick wall.

Sheez - never mind. The module CPM.pm had a cloaked "die" in it.

sloppy, sloppy.
 
U

Uri Guttman

DF> Sheez - never mind. The module CPM.pm had a cloaked "die" in it.

did you steal the romulan cloaking device? that is needed to debug many
modules.

DF> sloppy, sloppy.

wipe that spittle off your chin! :)

uri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top