On Tue, 06 Oct 2009, Konovalov, Vadim (Vadim)** CTR ** wrote:
> > From: Jan Dubois [mailto:j...@activestate.com]
> > On Mon, 05 Oct 2009, Konovalov, Vadim (Vadim)** CTR ** wrote:
> >
> > > we are not obliged to follow bad designs. findINC is bogus and it
> > > should not be a reason for anything otherwise inconvenient.
> >
> > You may want to take a look at File::ShareDir (and
> > File::ShareDir::Install
> > for MakeMaker installation support).
> 
> So MakeMaker will find it even in subdirectory, but still will
> install to ./site/lib/Tcl/Tk/ directory?

MakeMaker doesn't find it automatically, you need to tell it where
it is in your Makefile.PL with something like

   use File::ShareDir::Install qw(install_share);
   install_share "data";

before you call WriteMakefile(), and also add an additional postamble
with this:

    package MY;
    use File::ShareDir::Install qw(postamble);
 
Replace "data" with the subdirectory name where you put all the static
data files.  At runtime they will be located at something like

    ./site/lib/auto/share/Tcl-Tk/

But you don't really need to care as you find the location with

    use File::ShareDir qw();
    use Tcl::Tk;

    my $dist_dir = File::ShareDir::dist_dir("Tcl-Tk");

So yes, in some ways it is like findINC(), but using a more general
mechanism.

As I said, you may want to check it out; you may still end up not
liking it. :)

Cheers,
-Jan


Reply via email to