I have tried the following and find it to work. This is done with a non-privileged user. First find out where your perl command is:
# which perl
PERL5LIB
# echo $PERL5LIB
MAILTO=<my email address for the jobs output>
HOME=/home/myhome
PERL5LIB=/home/myhome/perl5/lib/perl5
0 2 * * * $HOME/<rest of path to perl>/perl $HOME/<path to my perl script> arg1 ...
local::lib
cpan
cpanm
PERL5LIB
local::lib
cpanm
The shebang (#!
) line of the script should point to the (perlbrew
-installed) perl
it is meant to run under. (This should be done as part of installing the script.) That's all you need.
0 2 * * * /path/to/script arg1 ...