in reply to Using variables within packages

It depends on how you are calling from script.cgi. And if you have defined a namespace inside, it may not directly access the other variables unless you use their full name ($main::var).

In fact you are using 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.