Is there a way to easily package resource files with a Perl module? Right now, I'm using %INC to find the location of the module then loading my resource files, but I'm looking for a solution where Perl will automatically reference the correct path (similar to how Java's class resources work).
File::ShareDir for loading resources at run-time.
File::ShareDir::Install orModule::Install::Share or Dist::Zilla::Plugin::ModuleShareDirs or Dist::Zilla::Plugin::ShareDir for handling the install-time copying of files.
(You may be wondering about why Dist::Zilla includes two plugins for doing this sort of thing. Reading the File::ShareDir documentation should make it clear - File::ShareDir allows you to install resource files in two different locations - one which is grouped by module name (e.g. Foo::Bar), and one which is grouped by distribution name (e.g. Foo-Bar). When you're creating distributions with more than one module, this is an important distinction.)