in reply to Base script behavior on presence (or non-) of a module
eval { use Fictitious::Module };
Use require, not use. use is executed at compile time of that code fragment, before the eval executes.
See also BEGIN — because use behaves like* a require with BEGIN wrapped around it.
___
* roughly like, that is. If you want to import stuff, you have to call import explicitly when you use require. See the mentioned docs for details.
|
|---|