I'd like to access template files during run time. What's a good practice for doing this?
I just learned about File::ShareDir and how it works with the share_dir directive of Module::Build and Module::Install.
This is great, since production code can do something like:
use File::ShareDir;
my $template_file = File::ShareDir::module_file('Module::Name', 'template/resume.tt')
But this doesn't seem to help me during development and test, where I'm used to accessing things (i.e. modules, scripts) from ../blib without having to install them.
Is there an analog to blib for share_dir so that I can use the same code in dev/test as I do in production?
And beyond the pre- vs. post- question relating to 'Build install', is there a recommended directory structure for where to hang the templates relative to the modules or relative to the distribution? Even lacking a recommendation, could you point me to a distribution that uses TT so that I could study how it does it?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |