use threads (); threads->new( sub { require Benchmark; Benchmark->import; # do your Benchmark stuff } )->join; print "Benchmark has not been loaded!\n" unless defined $Benchmark::VERSION;