The first: use lib '/lib' will attempt to find your library file in the root of the current drive. If you mean that it should look in the lib directory under the current directory, then use lib 'lib' would be appropriate, although potentially risky 1.
moritz has addressed the usage issue with your other attempt.
1 - Given that any attacker could probably copy your script anyway, I am having a hard time adding any additional risk by a user being able to replace your library with one that they 'own', therefore the use of 'potentially'.
Those docs are what I followed to get my above attempts.
OK: show us your code then. In the last 24 years I've used various flavors of use lib .. and push @INC,"..." with success. The only time either hasn't worked for me is when I fat fingered something (like a path).
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg