use Test::More tests => 2; for (1 .. 2) { eval "require Foo"; ok( $@, "Saw error loading Foo" ); }