Perl的核心库如何管理? [英] How are Perl's core libraries managed?

查看:67
本文介绍了Perl的核心库如何管理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的理解,Perl传统上仅包含核心功能,并且人们安装其他库来完成各种有用的(有时是非常基本的)事情.但是在某些时候,Perl默认提供了核心库",因此您可以在不安装它们的情况下使用这些库.

From my understanding Perl traditionally has only included core functionality, and people install additional libraries to do all sorts of useful (and sometimes very basic) things. But at some point there came to be "core libraries" which are shipped with Perl by default – so you can use these libraries without installing them.

来自Python,我很好奇它的管理方式.具体来说:

Coming from Python I'm curious how this is managed. Specifically:

  1. 如何选择图书馆?
  2. 这些库仍然有自己的版本号和发布时间表吗?
  3. 使用这些库时,您具有什么样的向后兼容性保证?
  4. 在系统中升级或降级这些库是否常见?这是在系统范围内完成的还是更具体的?
  5. 如果有一个错误修复程序需要更改API,那怎么办?
  6. 如何将功能添加到这些核心库中(如果有的话)?

推荐答案

  1. 当前,仅引导/安装其他库所需的库进入核心列表.
  2. 有些仅在Perl git存储库中.有些在CPAN和回购中具有双重作用.有时,错误会在存储库中修复,并且所做的更改会反向移植到CPAN版本.有时,CPAN上有一个新版本,并且Perl维护人员将模块检入到存储库中.
  3. 您可以依赖核心模块.删除之前有一个很长的弃用时间跨度,最近的例子是Switch.
  4. 包装商(例如为Linux发行版构建RPM的人)永远无法做到这一点;包含路径(@INC)的错误顺序不是它们的错,并且最终固定为5.12 .这就是为什么建议来自您来编译自己的perl而不弄乱系统安装的原因.在5.12中,您应该只使用CPAN安装核心模块的升级版本,并且将其安装在系统附带的模块上,但是由于新模块在包含路径中是旧模块,所以新模块要先于旧模块安装.当您use/require加载一个文件时.
  5. perlolicy 中列出.
  6. 对功能进行编程并对其进行测试,记录事物,然后在CPAN上发布,或者分别让维护者应用变更集.伴随有关于 p5p 的讨论.
  1. Currently, only libraries that are necessary to bootstrap/install other libraries go into the core list.
  2. Some are only in the Perl git repository. Some are dual-life on CPAN and in the repo. Sometimes bugs get fixed in the repo and the changes are backported to the CPAN version. Sometimes there's a new release on CPAN and a Perl maintainer checks in the module into the repo.
  3. You can rely on a core module. There's an very lengthy deprecation timespan before one gets removed, recent prominent example was Switch.
  4. Packagers (e.g. the people who build RPMs for a Linux distribution) never could get this right; the wrong order of include paths (@INC) not their fault, and finally fixed with 5.12. This is the reason where the recommendation comes from to compile your own perl and not mess with the system installation. With 5.12, you are supposed to just use CPAN to install an upgraded version of a core module, and it gets installed addtionally to the one shipped with the system, but since the new one comes before the old one in the include path, the new one gets loaded when you use/require it.
  5. Laid out in perlpolicy.
  6. Program the functionality and tests for it, document the thing, then release on CPAN or respectively have a maintainer apply the changeset. This is accompanied with a discussion on p5p.

这篇关于Perl的核心库如何管理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆