How do I use a Perl package known only in runtime?

后端 未结 7 528
忘掉有多难
忘掉有多难 2020-12-10 02:21

I have a Perl program, that needs to use packages (that I also write). Some of those packages are only chosen in Runtime (based on some environment variable). I don\'t want

7条回答
  •  执笔经年
    2020-12-10 03:12

    I think that a module loaded in runtime can be a Plugin. I have this kind of problem, having specific modules to some cases that are loaded in run time as plugins with Module::Pluggable.

    Maybe you need to change the logic of your modules, but it works and scale very well (my app started with four modules and now have twenty and it's growing).

提交回复
热议问题