You can always use relative paths here. E.g. use lib '..';
Another poster also mentioned the viability of the PERLLIB environment variable to override the default @INC. This is not guaranteed to be secure, though, so it will not work if your CGI is using Taint checking (-T).
As far as other users being able to examine your code and see where your libraries are, by seeing the use lib arguments or the value of @INC, I don't see what the big deal is. They can already see your code anyway.
Regardless, with big projects, you really should use relative paths in your use lib statement, just so that it's portable. You can move your app elsewhere without having to re-do all of that. Application-specific/bundled libraries should be referenced via use lib. |