use strict; use warnings; package MyMod; use Exporter (); use MyMod::db; use vars qw (@EXPORT @EXPORT_OK); use constant MYMOD_DEFAULT => 1; BEGIN { @EXPORT = (qw(MYMOD_DEFAULT)); #@EXPORT_OK = (qw(MYMOD_DEFAULT)); }; 1; use strict; use warnings; package MyMod::db; # I also tried use MyMod qw(MYMOD_DEFAULT) when constant was # in EXPORT_OK and not EXPORT. use base qw(MyMod); sub fred { print "hello" if (MYMOD_DEFAULT); } 1;