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

后端 未结 7 538
忘掉有多难
忘掉有多难 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:09

    You probably want to use require instead of use if you don't want it to happen at compile time, and then manually import any symbols you might need. See this link to the Perl Cookbook (from Google Books) for a good discussion of methods you can use to achieve what you want.

提交回复
热议问题