In addition to the execution order problem, you also need to adjust for the fact that import is called as a method call (e.g. Blah->import(Config=>'/home/me/config.txt') in your case), so the first thing in @_ is the name of the used module. You should have: my ($pkg, %args) = @_;