use MyPackage; my $pkg = MyPackage->new(); $pkg->load_config('my.conf'); $pkg->connect_to_imaphost();