logo       

Re: Fwd: How to put a path into a module during build time?: msg#00007

Subject: Re: Fwd: How to put a path into a module during build time?
Andrew Savige replied to me offlist with a good solution.
Taking a hint from lib/Net/Config.pm

my $file = __FILE__;
my $ref;
$file =~ s/Config.pm/libnet.cfg/;

Thank you all for your help!

This may be a good question to stick in a FAQ or some documentation
somewhere. This solution isn't specific to MakeMaker, and I can't say if
MakeMaker is the right place for this question, but the MakeMaker docs
were the first place I looked to find this answer, so who knows.

Thanks again,
--
Josh I.

On Thu, 4 Dec 2003, Randy W. Sims wrote:

> Forwarding to the MakeMaker ML because that seems a better place to get
> an answer. This suggests a more general question that might belong in
> the MakeMaker FAQ: What make variables are usefull to authors in
> Makefile.PL?
>
>
> On 12/3/2003 11:26 PM, jmiller@xxxxxxxxxxxxxxxx wrote:
>
> > I've looked through my O'Reilly bookshelf, google'd, RTFM's, and I haven't
> > found the *right* way to do this, and I'm not even sure this is the right
> > place to be asking this. Anyway...
> >
> > I have a perl module that needs to have access to a group of .png files
> > that ship with it. So, I made an /images directory under MyModuleName/
> > directory, and put them in there, and they get installed in the perl lib
> > directory just fine.
> > Now, my module needs to be able to find those, and use them, and I don't
> > know what the right way to do that is.
> >
> > I've found a way to do it, but it seems like an ugly kludge to me. I put
> > the text "----SRC_IMAGES----" in my perl module where I needed to know the
> > directory the images where in, and added a PM_FILTER to the Makefile.PL
> > like this:
> > 'PM_FILTER' => 'perl -pe 
> > "s!----SRC_IMAGES----!$(INSTALLSITELIB)/$(FULLEXT)!g"'
> >
> > The module has a way to override this default directory, so my tests just
> > override the default directory with "MyModuleName/images" so that it uses
> > the images from the distribution directory during testing.
> >
> > This will work as long as the module get's installed into
> > the $(INSTALLSITELIB) directory (which even works when you specify
> > PREFIX=/some/dir). But I can't imagine that this is the right way to do
> > something like this. I'm also concerned that it could get installed
> > somewhere else on some perl installations, but I don't know.
> >
> > For those interested, the module is Authen::Captcha.
> >
> > Any ideas?
> > --
> > Josh I.
> >
>
>
> --
> A little learning is a dang'rous thing;
> Drink deep, or taste not the Pierian spring;
> There shallow draughts intoxicate the brain;
> And drinking largely sobers us again.
>                  - Alexander Pope
>



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe