unbless implementation in Perl?

落花浮王杯 提交于 2019-12-12 03:38:43

问题


As many Perl developers know, unbless is used to remove the blessing from objects.
I am trying to understand how does it internally work by investigating its implementation.
I tried to check its implementation in its package Data::Structure::Util. Here's the Source:

sub unbless {
    unbless_xs( $_[0] );
}

Where may I find unbless_xs sub implementation/source ?


回答1:


It's implemented in C, you can check the source of the function at https://metacpan.org/source/ANDYA/Data-Structure-Util-0.16/Util.xs#L239




回答2:


If you look for Data::Structure::Util on metacpan.org you will see a Browse link to the left that will let you explore the contents of the distribution

The same applies to any CPAN module: there is no need for a download to examine the source code. In this case you will find Util.xs at the root of the structure

If you prefer, you can do the same thing on the CPAN site search.cpan.org but you must ascend to the (currently) Data-Structure-Util-0.16 distribution to find the browse link



来源:https://stackoverflow.com/questions/32028898/unbless-implementation-in-perl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!