in reply to Problem: Lazy Hash Evaluation

If the problem is that the value used_by is only present when you dump, there's clearly a missing piece here. There's nothing about perl to magically invent this used_by value. You ought to show your cards.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^2: Problem: Lazy Hash Evaluation
by Anonymous Monk on Feb 25, 2007 at 14:17 UTC
    > If the problem is that the value used_by is only present when you dump
    That's exactly the problem.

    > There's nothing about perl to magically invent this used_by value
    I was expecting it to be produced as part of the output of scan_deps() and the subrountine generic_rv_test() is therefore testing that it was produced.

    The only thing that I can think of that might explain this is that the data stucture $rv hasn't been completely filled out, as a result of scan_deps(), before it's used by generic_rv_test() except in the case when I dump $rv. However, that strikes me as being unlikely.

    > You ought to show your cards.
    I assume you mean give you the full code so here it is:

    The test script (4-pluggable_fake.t)"

    NB if I uncomment either of the two groups of comments in the above I get the used_by => ["Foo.pm"], line I'm testing for and all is OK.

    The complete generic_rv_test subrountine:

    And finally, the subroutine scan_deps comes from the CPAN module Module::ScanDeps.

    Thanks for the help,
    Adrian