Hi, good choice of tools.
"Firstly, to run a Perl script with the correct libraries, I need to put “carton exec” on the front of each script invocation. If you don’t do that then the correct Perl binary runs, but it fails because it cannot find the modules that carton installed.
How can I arrange things so that just running perl from a shell will do the right thing? (Run Perl 5.10.0 with the carton installed modules available), Perhaps by tweaking PERL5LIB for bash shells, or putting a wrapper script into the path? (note that I don't need to worry about multi user accounts here, all users login as root!)"
You can avoid having to use carton exec by setting the included library path:
...or set PERL5lIB.perl -Ilocal/lib/perl5 <cmd>
Note however that you can avoid using local/ at all and install the modules into the normal location if you use carton bundle to make an archive of the sources (after having installed them one time with carton install). This will be placed into vendor/cache but you can move it somewhere. Then install your dependencies at build time using cpanm --from file://path/to/the/cache.
I also recommend using perlbrew libs to keep your Perl version installation core-mdoules only. Then you can test installing dependencies multiple times without having to compile Perl over and over. I also use one perlbrew lib to build the cache, allowing carton to install in local/, and then after saving the cache as described above, I remove local/ and install to a fresh perlbrew lib for development, using the cache as described above.
Hope this helps!
In reply to Re: How to run a legacy perl version smoothly from perlbrew & Carton
by 1nickt
in thread How to run a legacy perl version smoothly from perlbrew & Carton
by chrestomanci
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |