if (defined eval "require My::Module") {
If the name of the module is constant, you should use eval BLOCK instead of eval STRING:
Apart from that, your approach is very common, and I have yet to see a better way to do it.if (defined eval { require My::Module }) {
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
In reply to Re: Best way to check for installed module
by Juerd
in thread Best way to check for installed module
by jmay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |