in reply to Distributing/Accessing Template::Toolkit Templates

If you install the templates in a directory relative to the directory containing your module then you can use %INC to get the path:

use warnings; use strict; use Foo; (my $fooDir = $INC{'Foo.pm'}) =~ s/Foo\.pm$//; my $tmplDir = "${fooDir}Templates";
True laziness is hard work

Replies are listed 'Best First'.
Re^2: Distributing/Accessing Template::Toolkit Templates
by three18ti (Monk) on Nov 10, 2013 at 18:57 UTC

    Hey, that's pretty clever. Are there any pitfals with this method? File::ShareDir seems like it might be the better option, unless for some reason you're limited in the modules you can use...

    Thanks for the reply!

      I'd go with File::Share. I was unaware of it. It looks a better fit for your distribution problem.

      True laziness is hard work