in reply to lib
lib is used by 'Perl logic' (related to require, use... and the @INC array )
I doesn't deal with 'user logic' when you open data files or whatever you want to open.
Rephrased in clear way :
the lib module is only a way to manipulate easily @INC which is used by perl to load modules/code (via require or use)
"Only Bad Coders Badly Code In Perl" (OBC2IP)