晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /proc/thread-self/root/usr/share/perl5/pod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/pod/perlmroapi.pod
=head1 NAME

perlmroapi - Perl method resolution plugin interface

=head1 DESCRIPTION

As of Perl 5.10.1 there is a new interface for plugging and using method
resolution orders other than the default (linear depth first search).
The C3 method resolution order added in 5.10.0 has been re-implemented as
a plugin, without changing its Perl-space interface.

Each plugin should register itself by providing
the following structure

    struct mro_alg {
        AV *(*resolve)(pTHX_ HV *stash, U32 level);
        const char *name;
        U16 length;
        U16 kflags;
        U32 hash;
    };

and calling C<Perl_mro_register>:

    Perl_mro_register(aTHX_ &my_mro_alg);

=over 4

=item resolve

Pointer to the linearisation function, described below.

=item name

Name of the MRO, either in ISO-8859-1 or UTF-8.

=item length

Length of the name.

=item kflags

If the name is given in UTF-8, set this to C<HVhek_UTF8>. The value is passed
direct as the parameter I<kflags> to C<hv_common()>.

=item hash

A precomputed hash value for the MRO's name, or 0.

=back

=head1 Callbacks

The C<resolve> function is called to generate a linearised ISA for the
given stash, using this MRO. It is called with a pointer to the stash, and
a I<level> of 0. The core always sets I<level> to 0 when it calls your
function - the parameter is provided to allow your implementation to track
depth if it needs to recurse.

The function should return a reference to an array containing the parent
classes in order. The names of the classes should be the result of calling
C<HvENAME()> on the stash. In those cases where C<HvENAME()> returns null,
C<HvNAME()> should be used instead.

The caller is responsible for incrementing the reference count of the array
returned if it wants to keep the structure. Hence, if you have created a
temporary value that you keep no pointer to, C<sv_2mortal()> to ensure that
it is disposed of correctly. If you have cached your return value, then
return a pointer to it without changing the reference count.

=head1 Caching

Computing MROs can be expensive. The implementation provides a cache, in
which you can store a single C<SV *>, or anything that can be cast to
C<SV *>, such as C<AV *>. To read your private value, use the macro
C<MRO_GET_PRIVATE_DATA()>, passing it the C<mro_meta> structure from the
stash, and a pointer to your C<mro_alg> structure:

    meta = HvMROMETA(stash);
    private_sv = MRO_GET_PRIVATE_DATA(meta, &my_mro_alg);

To set your private value, call C<Perl_mro_set_private_data()>:

    Perl_mro_set_private_data(aTHX_ meta, &c3_alg, private_sv);

The private data cache will take ownership of a reference to private_sv,
much the same way that C<hv_store()> takes ownership of a reference to the
value that you pass it.

=head1 Examples

For examples of MRO implementations, see C<S_mro_get_linear_isa_c3()>
and the C<BOOT:> section of F<ext/mro/mro.xs>, and
C<S_mro_get_linear_isa_dfs()> in F<mro_core.c>

=head1 AUTHORS

The implementation of the C3 MRO and switchable MROs within the perl core was
written by Brandon L Black. Nicholas Clark created the pluggable interface, 
refactored Brandon's implementation to work with it, and wrote this document.

=cut

haha - 2025