# MyMod.pm use strict; use warnings; package MyMod; use constant MYMOD_DEFAULT => 1; use base qw( Exporter ); # You need to subclass Exporter our @EXPORT = qw( MYMOD_DEFAULT ); # No extra parens needed 1; #### # MyMod/db.pm use strict; use warnings; package MyMod::db; use MyMod; # imports MYMOD_DEFAULT automatically sub fred { print "hello" if (MYMOD_DEFAULT); } 1; #### # fred.pl use strict; use warnings; use MyMod::db; MyMod::db::fred(); # fully qualified call #### hello