How can I conditionally import a package in Perl?

前端 未结 4 2016
死守一世寂寞
死守一世寂寞 2021-01-21 09:53

I have a Perl script which uses a not-so-common module, and I want it to be usable without that module being installed, although with limited functionality. Is it possible?

4条回答
  •  别那么骄傲
    2021-01-21 10:31

    I recommend employing Module::Load so that the intention is made clear.

    Edit: disregard the comments, Module::Load is in core.

提交回复
热议问题