With Perl, what is an easy way to handle different development versus production libs paths? I want to use my local box path for testing, but when I launch I want it to automatically point to the production lib path.
views:
114answers:
2
+6
A:
Take a look at the PERL5LIB environment variable, or for an even easier time, look at local::lib.
Chas. Owens
2009-07-01 22:23:31
Environment variables would be nice, but our version of cron does not use its users environment variables.
10rd_n3r0
2009-07-02 14:31:11
change the cron job line to "* * * * * PERL5LIB=blah script.pl"
Chas. Owens
2009-07-02 14:51:35
+1, I hadn't noticed local::lib before. Cool.
j_random_hacker
2009-07-03 06:13:38
+2
A:
I think your dev box should really be a VM with an identical configuration to production, so you won't need to change the library path.
Libraries should be installed by the same mechanism so everything's consistent.
Not doing this is likely to risk you releasing non-working code to production due to library version differences.
MarkR
2009-07-02 06:12:12
I understand this, but our development environment is on the same hardware as production.
10rd_n3r0
2009-07-02 14:30:26
It's frequently impossible to use the exact same configuration on production as on development. What if you need to specify IP addresses/hostnames and ports somewhere? Prod and dev environments can't both use the same IP and port.
j_random_hacker
2009-07-03 06:12:22