问题
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