Background. I’ve started using Strawberry Perl 5.22.0, and I’m trying to install tobyink’s useful P5U module. It has various dependencies, one of which fails to install: Module::Info, which fails 2/7 tests, 11/121 subtests. From the CPAN Testers Matrix it appears that Module::Info has failed almost universally across all platforms since Perl version 5.21.2. But are these failures serious or trivial? I decided to investigate.

Many of the failures are traceable to the Subroutine B::OP::parent redefined warning which appears to be a known problem. The tests fail in two test modules:

It is the single test failure in the second of these modules that is currently puzzling me.

The problem. The subtest which fails in t/n1_modules.t is this:

is_deeply( [ sort keys %mods ], [ sort qw(Cwd strict Carp) ], "Got the correct modules" );

It fails as follows:

# Failed test (t\n1_modules_required.t at line 17) # Structures begin differing at: # $got->[2] = 'Win32' # $expected->[2] = 'strict' # Looks like you failed 1 tests of 3. t\n1_modules_required.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests

This failing subtest is supposed to verify that the 3 listed modules are used or required by the test module t/lib/Bar.pm. Here are the full contents of that module:

package Bar; use Cwd; use Cwd 1; use Cwd 1.00102; use Cwd 1.1.2; BEGIN { cwd(); } BEGIN { $x = 1; $x = 2; require strict; } sub my_croak { require Carp; Carp::croak(cwd, @_); } 1;

It has 24 lines. I have used a hex editor to confirm that there is nothing extra “lurking” in the file — WYSIWYG. Note that there is no mention of the Win32 module in Bar.pm.

The labyrinth. The route taken by the chain of subroutine calls from the failing test back to the source of the discrepency is a tortuous one (for ease of reading I have replaced the full paths with ellipses):

  1. The failing subtest on line 14 of t/n1_modules_required.t compares a list of modules found against a list of expected modules. Since these are the modules used or required by t/lib/Bar.pm, the expected modules are (naturally) Cwd, strict, and Carp. The modules are found via the following calls:

    my $bar = Module::Info->new_from_module( 'Bar' ); ... my %mods = $bar->modules_required;
  2. Module::Info->new_from_module calls Module::Info->_find_all_installed, which returns this object:

    bless({ dir => "...\\t\\lib", file => "...\\t\\lib\\Bar.pm", name => "Bar", safe => 0, use_version => 0, }, "Module::Info")
  3. The call to Module::Info->modules_required gets a list of modules via the following call:

    my @mods = $self->_call_B('modules_used');
  4. _call_B in turn calls my($status, @out) = $self->_call_perl($command); with $command set to:

    "-MO=Module::Info,modules_used" "...\t\lib\Bar.pm"
  5. _call_perl calls @out = `$command 2>&1`; with $command set to:

    ...\perl\bin\perl.exe "-MO=Module::Info,modules_used" "...\t\lib\Bar. +pm"

The anomalies. Now, here’s where things get weird. First, we seem to have entered an infinite regression: modules_required calls _call_B, which calls _call_perl, which (apparently) calls modules_used. But modules_used calls modules_required, so we seem to be back where we started. But there is no infinite regression, so that can’t be what’s happening. Ok, so what does the call to:

...\perl\bin\perl.exe "-MO=Module::Info,modules_used" "...\t\lib\Bar. +pm"

actually do?

Second, that last call returns the following data:

Subroutine B::OP::parent redefined at ...\blib\lib/B/BUtils.pm line 21 +7. , use Cwd () at "...\t\lib\Bar.pm" line 3 , use Cwd (1) at "...\t\lib\Bar.pm" line 4 , use Cwd (1.00102) at "...\t\lib\Bar.pm" line 5 , use Cwd (v1.1.2) at "...\t\lib\Bar.pm" line 6 , use Win32 (0.27) at "...\t\lib\Bar.pm" line 624 , require bare strict.pm at line 15 , require bare Carp.pm at line 19 , ...\t\lib\Bar.pm syntax OK

Note that the Win32 module is reported as being used on line 624 of file Bar.pm. Not only does that file contain no mention of Win32; but it’s only 24 lines long! How does the call find an unmentioned module on a non-existent line of code?

I previously installed the same version (0.35) of Module::Info under Strawberry Perl 5.20.2, with no errors.

The questions. Can anyone shed any light on any of this? Suggest a way to carry the researches forward? Explain what happened between 5.20.2 and 5.22.0 to account for this bizarre behaviour? Assure me that force installing Module::Info will be safe?

Anyway, thanks for looking, :-)

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to Installing Module::Info 0.35 for Strawberry Perl 5.22.0 by Athanasius

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.