我如何安全地为Perl 5.8.9编译Perl 5.12模块?
我想在Perl 5.8.9中安装File :: Fetch,这是Perl 5.12中的核心模块。一般来说,我想编译和安装未来的模块在我的回溯的Perl因为我不能升级我的Perl。
I want to install File::Fetch, which is a core module in Perl 5.12, in my Perl 5.8.9. In general, I want to compile and install future-dated modules in my back-dated Perl because I cannot upgrade my Perl.
所以我下载了模块及其依赖项。这是相当痛苦的依赖树后,但我更关心的事实,其中一些是核心模块。如果我安装这些,我的Perl 5.8.9核心将有5.12的补丁。
So I downloaded the module and also its dependencies. It's quite painful following the dependency tree but I'm more concerned about the fact that some of them are core modules. If I install these, my Perl 5.8.9 core will have patches from 5.12.
我的问题是如何知道我是否可以安全地安装未来的模块,特别是核心模块。是否有一个教程用于测试Perl中的向后兼容性?
My question is how I can know whether I can safely install the future-dated modules, especially the core modules. Is there a tutorial for this purpose of testing backwardcompatability in Perl?
编辑:
我的模块是双重的,但是我不能使用cpan 。它说我的FTPsite.yaml有一个坏的元素。但是,我遵循模块的META文件中的依赖关系,我可以编译模块。这是cpan的奇数位吗?谢谢。
My module is dual lifed, but I cannot compile it using cpan. It said my FTPsite.yaml has a bad element. However, I followed the dependencies in the modules' META files, and I could compiled the module. Is this one of the odd bits with cpan? Thank you.
我手动安装所有依赖项后无法重新创建问题。但这里是错误:
I cannot recreate the issue after I installed all those dependencies manually. But here is the error:
cpan[5]> install File::Fetch
Running install for module 'File::Fetch'
Running make for B/BI/BINGOS/File-Fetch-0.24.tar.gz
CPAN: Digest::SHA loaded ok (v5.48)
CPAN: Time::HiRes loaded ok (v1.9715)
CPAN: YAML loaded ok (v0.72)
Alert: While trying to 'parse' YAML file
'/Users/martin/.cpan/FTPstats.yml'
with 'YAML' the following error was encountered:
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 3
Document: 1
at /opt/local/lib/perl5/site_perl/5.8.9/YAML.pm line 36
如果模块单独可用(即双重生命),和内核Perl,那么独立版本可以安全地安装在早期的Perl上,假设它的Makefile允许它。也就是说,如果你可以做 cpan< Module>
,它生成并测试没有错误,那么你就是好的。
If the module is available separately (i.e. "dual-lifed"), as both a standalone distribution and inside core Perl, then the standalone version is safe to install on an earlier Perl, assuming its Makefile allows it. That is, if you can do cpan <Module>
and it builds and tests without errors, then you are good.
唯一的问题是如果模块不是双重生命的,我在 - 这是你可能SOL
The only problem is if a module is not dual-lifed, which I opined about in this question -- which is where you are likely S.O.L.