I've run into a problem with a module I'm writing for CPAN. Using Extutils::makeMaker, I have it install into /path/to/perl/modules/Foo.pm . It has some plugins which go into /path/to/perl/modules/Foo/Bar.pm, /path/to/perl/modules/Foo/blurp.pm etc.

Now the problem is how to avoid hardcoding /path/to/perl/module/Foo into Foo.pm? I discovered PM_FILTER and changed Foo.pm to say INST_LIBDIR/Foo and made a filter like this in Makefile.PL:

'PM_FILTER' => 'perl -pe \"s|INST_LIBDIR|$(INST_LIBDIR)|g;\"'
The problem is this changes to blib/lib/Foo .

Now I have

'PM_FILTER' => 'perl -pe \"s|INST_LIBDIR|$(INSTALLVENDORLIB)|g;\"'
which is more like what I want but obviously won't work if the user does a site, or private install.

So what should I do to solve this problem?

--
જલધર


In reply to How to make a module aware of where it is installed? by jaldhar

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.