in reply to How to assign a variable with a value read from a config file
Maybe I'm over simplifying but even though that other answers here are good solutions, it looks from your post you don't care about the vars being global and want the varname used in the config file to be the scripts varname
Just make the format of your config file as follows:
$VARNAME="value";
One define on each line and be sure the last line is '1;' without the quotes.
Add the following line to your script -
require './configfile';
If the directory of the configfile is not the same as the script the substitute the ./ for the directory name i.e. /tmp/
Why didn't I take the Blue Pill