package MyConfig; use constant CONFIG_PATH => q(/usr/share/myconf.cfg); my $_cfg = undef; sub fetch { $_cfg ||= AppConfig->new( )->file( CONFIG_PATH ); return $_cfg; } package main; fooble(); sub fooble { my $cfg = MyConfig->fetch; print "fooble is", $cfg->fooble(), "\n"; }