in reply to variables not being set from a configuration file

As rovf points out, you declare lexical, but end up setting, global variables i.e. instead of my $var; ...., try declaring the variables with either our $var;.. or even use vars qw/$var .../;

A user level that continues to overstate my experience :-))