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


In reply to Re^4: Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM? by ELISHEVA
in thread Do Pure Perl CPAN packages really need to use ExtUtils::Command::MM? by ELISHEVA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.