A few points:
- 'use' instead of 'require'. Then the inclusion is done at compile time and the subs can be found early by the compiler.
- use warnings; That will tell you what's not to like. In older Perl, make that '-w' on the shebang line.
- use strict; If you don't actually declare that, it can't tell you what's wrong.
- You have globals in the library, and making them lexical does not improve matters. The place to deal with an instance variable like $user is in the main script, where it should be lexical. If you truly have global parameters, consider use constant ADMIN => 'admin';
- At the top of your library, just say package Site::common; and save it as 'Site/common.pm'. No OO needed it can just be a bag of subroutines.
I recommend
perlmod,
perlsec, and
perlvar.
Update: crazyinsomniac reminds me that warnings may also be turned on by $^W=1;.
After Compline,
Zaxo