in reply to Re: import() not getting called. Huh?
in thread import() not getting called. Huh?

I have a die in the M3::import, so if you got "so what?" it illustrates the problem! Sorry if I wasn't clear last night; it was late and I was frustrated.

Comment out the last stanza (the second use of M2) and see what happens.

How can something following me affect my call? It appears that M3::import is not being called if M2 is used both before and after it in the source file (into different packages, though).

Your trace shows that M3 loaded (print at the end of the file before the 1;), but there is no report that import was called with its parameters. Instead, the next report is that M2 was imported again.

Replies are listed 'Best First'.
Re: Re: Re: import() not getting called. Huh?
by BrowserUk (Patriarch) on Dec 20, 2002 at 17:57 UTC

    Sorry. I was mis-interpreting the output, but I tried something else

    I commented out  #Err "NOT IMPLEMENTED YET."; line 183 of VA.pm and ran the following script.

    package C1; use M1 v1.0 qw/&foo bar baz quux bazola $ztesch --dump/; #package C2; use M2 v1.0 qw/ foo baz $ztesch :tag1 --dump/; package C3; use M3 v1.0 qw/foo --dump/; print "so what?\n"; package C4; use M2 v2.3.4.5 qw/foo baz --dump/;

    M3 was imported, but M2 fails with a version check failure, so I replaced the last line above with

    package C4; use M2 v1.0 qw/foo baz --dump/;

    And that gave me identical results. M3 imported, M2 fails?

    Output

    Then I moved the first M2 line below the M3 line; and again M3 imports but the M2 line--that works above it--fails when moved below it?

    Again, I don't know if this helps any, but I thought I'd pass the information along in case it does. If this is another red-herring and you'd prefer not to get any more, just say so and I'll stop:).


    Examine what is said, not who speaks.

      OK, so importing M1, M3, M2 in that order makes M2 fail with VERSION being not found, right? It's not complaining that the version number is bad, but that the VERSION function is not found at all, which is strange for a couple of reasons: (1) it works in other modules, and (2) if it was not defined it would be found in UNIVERSAL.

      But, it is calling M3::import in this case.

      I'm wondering if M3::import caused something to be changed (incorrectly) in M2, not just in C3 as intended. That "clobber the wrong thing" could explain my first observation, that a function was not being called, if the symbol table entry for that function were altered.

      What makes me suspect a compiler bug or other bizzare issue is that commenting out something that will happen later changes the behavior.

      Maybe using Dumper on the symbol table to see if/when something unexpected changes...I'm glad it's friday.

      —John