Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found