I recently created a little Perl application that utilizes a few non-core modules that will need to be installed via CPAN.
Is there a way to distribute the application with the ability to check to see if the required modules are installed and pull them from CPAN if they aren’t? I suppose I am looking for something similar to the CPAN auto-dependency-install feature.
I thought about using module-starter and Module::Install to create a module-like directory structure and then tailor the Build file to install the application to /bin… but I’m not sure if this is a shoe-horn solution.
It’s not a shoe-horn solution, but the Right Thing to do. You should let a specialised tool handle the dependencies because of the corner cases, e.g. write in the installation instructions:
cpan .in the unarchived directory.You need not change the Build file to install programs in the
bindirectory, it does this by default.