merlyn, I do not belive that. Please explain further, because I would say everybody looses if you use lib.
My experience tells me, to avoid hardcoded variables whenever possible, especially paths to files, for the following reasons:
1. if you move the script, it possibly does not run anymore, the path does not exist for a different user on the network. So you have to modify the script and have dozens of version after a while. (Think of big networks, different usergroups with access rights etc.)
2. You have a testbed with your modules and a different production environment. You will have to modify your programm after the release-test.For the stuff with legal impacts, I will never get through revision, even if I do the same with PERL5LIB, because of the remaining risk of further changes.
3. use lib is at the beginning, other constants maybe not, but somewhere hidden in a module etc. This is hard to maintain.
4. You have a well coded script, that can be used for different purposes, you change a setting in an ini-file instead of the code itself.
5. customization or internationalization can be solved with a module on a different path (use Perl code to set constants). You have to switch the path maybe repeatedly.
etc. etc.
But for the use lib; I consider the discussion not necessary, because it is quite easy to avoid it most times:
- have the modules in a subdirectory
- install them properly, so they are in .../site/lib and in the path beneath the runtime.
--
And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)
In reply to Re: Re: Using a paramter value to call a module
by Brutha
in thread Using a paramter value to call a module
by Hagbone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |