- or download this
package Foo;
use Bar;
1;
- or download this
package Bar;
0;
- or download this
use Test::More tests => 2;
...
eval "require Foo";
ok( $@, "Saw error loading Foo" );
}
- or download this
1..2
ok 1 - Saw error loading Foo
...
# Failed test 'Saw error loading Foo'
# at check_foo.pl line 5.
# Looks like you failed 1 test of 2.
- or download this
my %have_module;
sub have_module {
...
}
return $have_module{$mod};
}