Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Module::Info / Win XP problem

by Jazz (Curate)
on Jun 25, 2002 at 06:21 UTC ( [id://177028]=perlquestion: print w/replies, xml ) Need Help??

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

Replies are listed 'Best First'.
Re: Module::Info / Win XP problem
by Baboon (Acolyte) on Jun 25, 2002 at 07:14 UTC
    I've just followed your link to Module::Info on CPAN and found there that it is stated that MSWin32-x86-multi-thread FAILED.

    Well, this module does not support Win32, and not only WinXP is in trouble here - WinNT, Win95, WinME to add to this list.
    Best way here is to improve Module::Info: I suspect "2>&1" is a tough place here, but this needs deeper investigation than I just did.

    Best wishes,
    I.R.Baboon.

      Thank you for your reply.

      I saw that it failed the test as well. But since it worked at the dos prompt, it would seem logical that there should be a way to make it work in the program, shouldn't it? :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://177028]
Approved by Zaxo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-24 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found