From: <sono...@fannullone.us> Subject: Re: Using perlbrew to change Perl version for scripts
On Jun 3, 2012, at 6:06 AM, Octavian Rasnita wrote:
but a user has only a single cron job so it is not such a big issue.
And therein lies the rub. Why can't perlbrew do that for us automatically? perlbrew switch XXX... and you're done!
Your solution makes sense if you only change versions once a year when Perl is upgraded, but my original inquiry was for testing purposes. If you want to test all your scripts with different versions of Perl, making only one change in perlbrew would be sooo nice. It does it for the command line - why not for the shebang line?
For the testing purposes, when you might need to change the version of Perl very often for testing some programs, Perlbrew can help you because you can run the programs in command line. But I guess you don't want to set cron jobs and keep changing the version of Perl. You can test those programs in command line, and after that configure cron with the version of perl you choose.
The cron jobs don't use the system Perl, but they use the first Perl found in PATH. If those cron jobs won't find any Perl in PATH, they won't run at all. And you, or Perlbrew or somebody else should set a default PATH for the shell which is used by the cron jobs if you want a certain version of Perl to be run.
If somebody knows where it keeps the configuration settings the shell which is used by cron, then she or he might ask Perlbrew's author to also make changes in that configuration file also (if there is one), and then the changes will also work in cron jobs without needing to manually set the PERL5LIB and the PATH there.
Octavian -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/