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

Discussion in 'Perl Misc' started by David Filmer, Dec 18, 2009.

  1. David Filmer

    David Filmer Guest

    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!
     
    David Filmer, Dec 18, 2009
    #1
    1. Advertising

  2. David Filmer

    Uri Guttman Guest

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

    >>>>> "DF" == David Filmer <> 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 ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
     
    Uri Guttman, Dec 18, 2009
    #2
    1. Advertising

  3. David Filmer

    David Filmer Guest

    Re: Getting strange double-error messages on a "use <module>" - doesnot seem to be @INC problem

    On Dec 18, 2:13 pm, "Uri Guttman" <> 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, Dec 18, 2009
    #3
  4. David Filmer

    David Filmer Guest

    Re: Getting strange double-error messages on a "use <module>" - doesnot seem to be @INC problem

    On Dec 18, 2:32 pm, David Filmer <> 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.


    --
    David Filmer (http://DavidFilmer.com)
     
    David Filmer, Dec 18, 2009
    #4
  5. David Filmer

    Uri Guttman Guest

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

    >>>>> "DF" == David Filmer <> writes:

    DF> On Dec 18, 2:32 pm, David Filmer <> 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! :)

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
     
    Uri Guttman, Dec 19, 2009
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sydex
    Replies:
    12
    Views:
    6,655
    Victor Bazarov
    Feb 17, 2005
  2. Tony
    Replies:
    1
    Views:
    181
    Tony Curtis
    Aug 20, 2003
  3. Replies:
    6
    Views:
    951
    Sherm Pendley
    May 19, 2005
  4. kellinorman
    Replies:
    7
    Views:
    132
    Bart Lateur
    Apr 19, 2006
  5. Replies:
    3
    Views:
    1,798
Loading...

Share This Page