use strict; use MyConfig; my $CONFIG = "somefile.xml"; &main; sub main { my configReader = MyConfig->new( $CONFIG ); configReader->loadConfig; }