use threads (); my $thread; BEGIN { # execute this at compile time $thread = threads->new( sub { print "Benchmark has not been loaded!\n" unless defined $Bench +mark::VERSION; # do your Benchmark stuff } ); } use Benchmark; $thread->join;