in reply to Best way to check for installed module
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Best way to check for installed module
by extremely (Priest) on Apr 04, 2002 at 20:40 UTC |