in reply to Base script behavior on presence (or non-) of a module
I strongly suggest using Class::Load to handle this, but if you'd rather homebrew a solution...
if (eval { require Fictitious::Module; 1 }) { # code that uses Fictitious::Module } else { warn "Can't find Fictitious::Module. Soldiering on regardless..."; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Base script behavior on presence (or non-) of a module
by Anonymous Monk on Dec 21, 2011 at 16:54 UTC | |
by Eliya (Vicar) on Dec 21, 2011 at 18:31 UTC | |
by Anonymous Monk on Dec 21, 2011 at 18:54 UTC | |
by tobyink (Canon) on Dec 31, 2011 at 21:05 UTC |