in reply to How not to check if a module is installed
use Test::More tests => 2; for (1 .. 2) { eval "require Foo" or delete $INC{'Foo.pm'}; ok( $@, "Saw error loading Foo" ); } __END__ ok 1 - Saw error loading Foo ok 2 - Saw error loading Foo
delete doesn't clear $@.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How not to check if a module is installed
by xdg (Monsignor) on Oct 24, 2007 at 16:06 UTC |