Don't use the .pm files directly. Make a cpanfile of your requirements then you can use Carton to create an offline bundle for installation, which can be installed directly by cpanm on the target system as long as you used a recent Carton. carton install; carton bundle then copy the vendor/cache directory to the target and see https://metacpan.org/pod/Carton#Bundling-modules.