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, [EMAIL PROTECTED] 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 >
