WARNING: If you install perl modules using CPAN as root, there is a risk that upgrading to a new OpenBSD release will cause library version mismatches and break existing perl scripts.
For example, to instal the local::lib module:
$ doas pkg_add p5-local-lib
If a package is not available, consider using the local::lib module that comes with CPAN. The command is:
$ cpan -I $MODULE
Replace $MODULE with the module name.
Then, include this line in your perl script before using the module:
Note: This page should probably have more details and be on a bugs/troubleshooting page for openbsd.
umask will cause an incorrect permissions for some perl dirs, created during
cpan usage. As result only you will have access to the required perl libraries. It is importan if you wanna to share those libraries with other users. You need set
umask to default value before execute
The default mask value is S_IWGRP|S_IWOTH (022, write access for the owner only). (
If perl libraries have the wrong dependency versions, you can have CPAN recompile all modules:
$ perl -MCPAN -e 'recompile()'