in reply to Re^3: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
in thread Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
I want to ++ this a thousand times tonight. This worked! I totally missed the "MY::post_initialize" when I was reading the docs and studying the source code yesterday.
I had to modify it slightly so I didn't clobber the user's settings. Some people install CPAN software into their home dir and may be using PERL5LIB to add those to their module search path.
use File::Spec; use Config; sub MY::post_initialize { my $sInc = File::Spec->rel2abs('inc', $ENV{PWD}); my $sSep = $Config{path_sep}; my $PERL5LIB=$ENV{PERL5LIB}; return "PERL5LIB := $PERL5LIB$sSep$sInc"; }
Update: After grepping through the code one more time I found where this is documented:ExtUtils::MM::Unix. I do remember reading it yesterday, but when I read the documentation I didn't connect the dots:
Returns an empty string per default. Used in Makefile.PLs to add some chunk of text to the Makefile after the object is initialized.
The object, what object? Thanks once again.
Update: added comment about portable way to append paths to PERL5LIB
Update: updated with resolution portability issue
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM?
by Anonymous Monk on Feb 18, 2011 at 01:43 UTC | |
by ELISHEVA (Prior) on Feb 18, 2011 at 03:27 UTC | |
by Anonymous Monk on Feb 18, 2011 at 04:50 UTC | |
by ELISHEVA (Prior) on Feb 18, 2011 at 05:11 UTC | |
by Anonymous Monk on Feb 18, 2011 at 08:42 UTC | |
|