I like
eval { require Foo::Bar } or warn "Eval failed: $@";
Since require only returns true or an exception. The import can be done later, although I usually don't want to import from a dynamically loaded module.
Update: Oops, silly me! Replaced eval "" with eval {}. Thanks tye.
In reply to Re^4: BEGIN and compile-time
by ikegami
in thread BEGIN and compile-time
by jbert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |