Hello,

I'm working on program that uses Module::Info and have run into a problem.

First, it's important to note that because the intended audience is primarly users without root access, I've simply copied over the contents of the lib directory in the distribution and used the directory. This works perfectly on Linux. The problem is on Win XP.

Here's a snippet that prints out the names of a given module's subroutines and the range of line numbers that the subroutine lives in:

my $mod = Module::Info->new_from_module( $module ); eval "require 5.6.1"; # the Module::Info 'subroutines' function requi +res 5.6.1+ unless ( $@ ){ my %subs = $mod->subroutines; print map { Tr( td( $_ ) ) } keys %subs; }

Again, this works correctly on Linux. On XP, the same code throws this warning into the error log and yields no results (line split for legibility):

B::Module::Info,subs_called use failed with 16777215 saying: at Module/Info.pm line 422.

The problem refers to this line in Module::Info:

my @out = `$^X "-MO=Module::Info,$arg" $mod_file 2>&1`;

$arg is the Module::Info function (in this case, subroutines) and $mod_file is the name and path of the module. (This same line also is being pestilent with -T, even after untainting.)

It was easy to figure out that since the module was "uploaded" (and not installed), that the problem was that it couldn't find B::Module::Info. So I played around a bit in dos (or whatever it's called these days), and this worked (line split lines for legibility):

perl -Id:/apache/home/perldiver/www -MO=Module::Info,subroutines d:/Apache/usr/site/lib/HTML/TokeParser.pm 2>&1 > d:/out.txt

A couple of lines of the result:

HTML::TokeParser::get_text at d:/Apache/usr/site/lib/HTML/TokeParser.p +m from 64 to 97 HTML::TokeParser::new at d:/Apache/usr/site/lib/HTML/TokeParser.pm fro +m 26 to 41

So, for brute force testing purposes only, I changed $^X to "$^X -Id:/apache/home/perldiver/www" in the program so that the Module::Info system call had the switch (also tried it in Module::Info). Neither worked. I then modified the actual system call in Module::Info to include -Id:/apache/home/perldiver/www and that didn't work either. I even threw in a use lib directive into Module::Info and that didn't work either.

I'm about to say "Sorry XP people, that feature ain't gonna work.. Get Linux :)", but I wanted to see if I'm just missing something simple.

Thanks for any insight you may be able to offer :)

Jasmine


In reply to Module::Info / Win XP problem by Jazz

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.