No it's not you at all. I have made a patch for ExtUtils::Installed that will allow you to supply a list of locations which are outside the perl install prefix - I need to add some tests and change the documentation before I send it to p5p but this:
--- Installed.pm.orig 2004-07-20 16:37:50.000000000 +0100
+++ Installed.pm 2004-07-20 17:23:53.000000000 +0100
@@ -77,24 +77,32 @@
}
sub new {
- my ($class) = @_;
+ my ($class, @dirs) = @_;
$class = ref($class) || $class;
my $self = {};
- my $archlib = $Config{archlibexp};
- my $sitearch = $Config{sitearchexp};
+ push @dirs, $Config{sitearchexp}, $Config{archlibexp};
# File::Find does not know how to deal with VMS filepaths.
- if( $Is_VMS ) {
- $archlib = VMS::Filespec::unixify($archlib);
- $sitearch = VMS::Filespec::unixify($sitearch);
- }
- if ($DOSISH) {
- $archlib =~ s|\\|/|g;
- $sitearch =~ s|\\|/|g;
+ foreach ( @dirs ) {
+ if (!m!$Config{archname}/?$!) {
+ $_ = File::Spec->catfile($_, $Config{archname});
+ }
+
+ if( $Is_VMS ) {
+ $_ = VMS::Filespec::unixify($_);
+ }
+
+ if ($DOSISH) {
+ s|\\|/|g;
+ }
+
}
+ my $archlib = @dirs[-1];
+
+
# Read the core packlist
$self->{Perl}{packlist} =
ExtUtils::Packlist->new( File::Spec->catfile($archlib, '.packli
+st') );
@@ -108,11 +116,15 @@
# Hack of the leading bits of the paths & convert to a module
+ name
my $module = $File::Find::name;
- $module =~ s!\Q$archlib\E/?auto/(.*)/.packlist!$1!s or
- $module =~ s!\Q$sitearch\E/?auto/(.*)/.packlist!$1!s;
+
+ foreach my $dir ( @dirs ) {
+ $module =~ s!\Q$dir\E/?auto/(.*)/.packlist!$1!s and last;
+ }
+
my $modfile = "$module.pm";
$module =~ s!/!::!g;
+ print $module,"\n";
# Find the top-level module file in @INC
$self->{$module}{version} = '';
foreach my $dir (@INC) {
@@ -131,8 +143,8 @@
ExtUtils::Packlist->new($File::Find::name);
};
- my(@dirs) = grep { -e } ($archlib, $sitearch);
- find($sub, @dirs) if @dirs;
+ my(@search_dirs) = grep { -e } (@dirs);
+ find($sub, @search_dirs) if @search_dirs;
return(bless($self, $class));
}
Will allow you to do something like:
use ExtUtils::Installed;
+
+
use lib qw( /home/jonathan/foo/lib/perl5/site_perl/5.8.1);
+
my $ff = ExtUtils::Installed->new('/home/jonathan/foo/lib/perl5/site_p
+erl/5.8.1');
+
print $ff->files('Foo','all');
where I have installed the module 'Foo' with a PREFIX of '/home/jonathan/foo'
/J\
-
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.