Perl 内置 `Internals::` 包的文档在哪里?
当使用 keys %::
获取当前加载的根命名空间的列表时,默认情况下会加载 Internals::
包(以及 UNIVERSAL::< /code> 和其他一些)。但是,我没有找到
Internals::
keys %{Internals::}
returns SvREFCNT hv_clear_placeholders hash_seed SvREADONLY HvREHASH rehash_seed
中函数的任何文档>
所有这些都可以在 Perl 的 C API 文档中查找,但是有针对它们的 Perl 级别文档吗?包裹稳定吗?它被多个核心模块使用(其中一个是 Hash::Util
),所以我想它是这样的,但是缺乏文档有点令人不安。
我在 Perl 发行版中没有看到 Internals.pm
(也许名称不同?),并且它不是 CPAN 上的 Internals
模块。
注意:我完全理解 Internals::
中的函数有潜在危险,并且我没有任何特定用途。我正在阅读 Hash::Util
的源代码并发现了它。
When using keys %::
to get a list of the currently loaded root namespaces, the Internals::
package is loaded by default (along with UNIVERSAL::
and a few others). However, I haven't found any documentation for the functions in Internals::
keys %{Internals::}
returns SvREFCNT hv_clear_placeholders hash_seed SvREADONLY HvREHASH rehash_seed
All of these can probably be looked up in Perl's C API docs, but is there any Perl level documentation for them? Is the package stable? It's used by several core modules (Hash::Util
for one), so I imagine it is, but the lack of documentation is a bit troubling.
I didn't see Internals.pm
in the Perl distribution (different name maybe?), and it is not the Internals
module up on CPAN.
Note: I fully understand that the functions in Internals::
are potentially dangerous, and I do not have any particular use in mind. I was reading through Hash::Util
's source and came across it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IIRC 代码不是Internals.pm,而是libinternals.c。看起来它们曾经位于 Perl 5.8 中的universal.c 但已迁移出去。
根据 03/2009 和 Perl 5.10,它们没有按照此 perlmonks 线程进行记录。
另外,在同一个线程中, ysth 指出:
IIRC the code is not Internals.pm but libinternals.c. It looks like they used to be in universal.c in Perl 5.8 but got migrated out.
As per 03/2009 and Perl 5.10 they were not documented as per this perlmonks thread.
Also, in the same thread, ysth states: