Found it: I was passing a list ref to a function that "ate" it, shifting the contents off as it processed. So it only worked the first time it was called.

This affected the export-by-tag feature, and Exporter::VA uses itself, and both M2 and M3 used the ':normal' tag when importing Exporter::VA. So the second time it expanded to nothing.

That does not explain the observation that removing the 3rd call made the second work. Perhaps my early print statements were not clear enough when I first started exploring. Since this is what made me panic (cause should preceed effect!), it underscores the point that good note-taking and observations are essential. However, it's a truism that these things happen late at night when one is almost done implementing a new feature...so it generally doesn't get handled as formally (at first).

—John


Can someone please help me with this? I'm at my wit's end, and it's driving me nuts.

Basically, the code looks like this:

package C1; use M1 v1.0 qw/--verbose_import &foo bar baz quux bazola $ztesch --dum +p/; package C2; use M2 v1.0 qw/ foo baz $ztesch :tag1/; package C3; use M3 v1.0 qw/ --verbose_import foo --dump/; print "so what?\n"; package C4; use M2 v2.3.4.5 qw/foo baz --dump/;
The funny thing is that M3::import is never getting called, if and only if I have the M2 usage both before and after it. If I remove either of those, then M3 works fine.

I tried a simple test case, (files test2.perl, Dummy*.pm) but it did not reproduce the problem. My actual test, with stuff stripped out to make it what I show above, is it test1.perl. All this is posted at http://64.127.185.180/help1.zip (18305 bytes). Would someone take a look at it? Maybe it's just something I'm not seeing and need another pair of eyes.

Thanks,
—John

Update: When run, I expect the M3::import call to report its parameters, then die on foo. It should never get to the C4 usage of M2 (again) or the non-BEGIN stuff. Comment out one of the use M2's and see the difference.


In reply to import() not getting called. Huh? by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.