in reply to Using variables within packages
It depends on how you are calling package.pl from script.cgi. And if you have defined a namespace inside package.pl, it may not directly access the other variables unless you use their full name ($main::var).
In fact you are using variables.pl as a configuration file, right? Maybe it would be more clear and more safe to use a plain text configuration file and read it with Config::Simple.