views:

114

answers:

2

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.

+6  A: 

Take a look at the PERL5LIB environment variable, or for an even easier time, look at local::lib.

Chas. Owens
Environment variables would be nice, but our version of cron does not use its users environment variables.
10rd_n3r0
change the cron job line to "* * * * * PERL5LIB=blah script.pl"
Chas. Owens
+1, I hadn't noticed local::lib before. Cool.
j_random_hacker
+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
I understand this, but our development environment is on the same hardware as production.
10rd_n3r0
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