http://qs321.pair.com?node_id=177028

Jazz has asked for the wisdom of the Perl Monks concerning the following question:

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