Randy W. Sims <[EMAIL PROTECTED]> writes:
>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?
>> 
>> 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.

If they are in the perl lib directory why not use @INC to find them?
e.g. Tk has:

sub findINC
{
 my $file = join('/',@_);
 my $dir;
 $file  =~ s,::,/,g;
 foreach $dir (@INC)
  {
   my $path;
   return $path if (-e ($path = "$dir/$file"));
  }
 return undef;
}




>> 
>> 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 obvious way to do this is to ship   Foo.pm.PL rather than Foo.pm 
and let .PL rules call the .PL file to generate the .pm file


Reply via email to