Starting to use File::ShareDir
File::ShareDir is a module to allow you to fetch files that were copied during install-time of your distribution/module. Things like templates, images, XMLs or any other data that you need falls under the category of things you might want to have installed.
The installation itself is done by the module distribution toolchain (initially implemented in Module::Install but now available on all, including Dist::Zilla). You can read on how to add a share files in a directory on the respected documentation of you toolchain selection (or Dist::Zilla).
To reach the files after they were installed you need to use File::ShareDir. It has a few functions that fetch files or directories by module or distribution. It's comfortable, it's easy, it's simple.
However, I was reluctant to use it since I've heard about it mainly since I don't know what to do if I want to use the data files without actually installing the module each time.
Today, I finally understood it (after digging in the docs, the bug list, AnnoCPAN and the raw code). Yes, I had to go through these steps to find out. Apparently it's not documented, nor was the ticket of its documentation request (which doesn't include enough information anyway) wasn't handled yet.
The trick is, File::ShareDir uses @INC as well, in order to find your data files. This means that if you run your toolchain (perl Makefile.PL && make; or perl Build.PL && ./Build;), then you will be able to use the blib/lib folder:
perl -Iblib/lib bin/your_app
(or however you run your stuff)
If you're using Dist::Zilla, you can run dzil build, and grab the Makefile.PL or Build.PL from there and run them.