No need. eval returns undef on expection. Otherwise, it returns true because of the 1;. It would return true even without the 1; because require always returns true or an exception.
Incidentally, eval EXPR is not needed here. eval BLOCK suffices.
if (eval { require LWP::UserAgent })
In reply to Re^2: Testing if machine has LWP... not working
by ikegami
in thread Testing if machine has LWP... not working
by lokiloki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |