Why can't I simply copy installed Perl modules to other machines?

后端 未结 2 1286
独厮守ぢ
独厮守ぢ 2021-01-13 05:18

Being very new to Perl but not to dynamic languages, I\'m a bit surprised at how not straight forward the manage of modules is.

Sure, cpan X does theore

2条回答
  •  渐次进展
    2021-01-13 06:11

    Now, Perl is a dynamic language, but that doesn't imply that everything that people write is portable across platforms. That's not the fault of the language. It's not even the fault of the programmer. Some things, like Win32::OLE shouldn't work on Unix. :)

    Other dynamic languages will have some of the same problems. If you have to compile C code, you won't be able to merely copy files to another machine. Some distributions configure the code slightly differently depending on your operating system, etc.

    Even if you could copy files, you have to ensure that you copy all of the files that you need. Do you know everything that you need for a particular module? Remember, many of them have dependencies.

    Most of the problems you're having aren't anything to do with the language. You're having trouble with the tools. If you want a zero conf CPAN tool that makes all the decisions for you, try cpanminus. It's mostly the same thing that you'd get out of cpan (although different code), but it makes all of the decisions for you. It doesn't run any of the distribution tests, and it installs into your user directory. When you need something that gives you control, come back to cpan.

提交回复
热议问题