Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

David Filmer

unread,
Dec 18, 2009, 5:05:01 PM12/18/09
to
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!

Uri Guttman

unread,
Dec 18, 2009, 5:13:44 PM12/18/09
to
>>>>> "DF" == David Filmer <use...@davidfilmer.com> writes:

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

--
Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------

David Filmer

unread,
Dec 18, 2009, 5:32:06 PM12/18/09
to
On Dec 18, 2:13 pm, "Uri Guttman" <u...@StemSystems.com> wrote:

> hi dave!
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.

--
David Filmer (http://DavidFilmer.com)

David Filmer

unread,
Dec 18, 2009, 5:47:58 PM12/18/09
to
On Dec 18, 2:32 pm, David Filmer <use...@davidfilmer.com> wrote:
> 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.

Uri Guttman

unread,
Dec 18, 2009, 7:32:57 PM12/18/09
to
>>>>> "DF" == David Filmer <use...@davidfilmer.com> writes:

DF> On Dec 18, 2:32�pm, David Filmer <use...@davidfilmer.com> wrote:
>> Before, I felt like I was going in circles. �Now I feel like I've hit
>> a brick wall.

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! :)

0 new messages