perl-MOP-0.14-alt2.noarch.rpm


Advertisement

Description

perl-MOP - Perl extension providing a meta-object protocol for Perl modules

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package filename perl-MOP-0.14-alt2.noarch.rpm
Package name perl-MOP
Package version 0.14
Package release alt2
Package architecture noarch
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 81.23 KB
Installed size 81.23 KB
This module provides a simple and, in my opinion, powerful meta-object protocol (MOP)
for Perl5 modules.
In short, such MOP allows to *trap the method calls* made on an object
(represented by a reference) before they reach the original module implementing
them. These method calls are redirected to another module, called the meta-module,
before their execution. The original (legitimate) destination of the method call is in
the (base) module. Of course, one day or another, the meta-module should perform the actual
normal method call at the base level, but it can do some nice things before or after
doing that. And this is the whole purpose of its existence.
MOP::MOP implements the base level part of the protocol. This module is tightly
linked with module MOP::MetaModule which implements the
other upper part of the behavior, i.e. the generic behavior of a meta-module.
In the above example, MyBaseModule is the base module, and MyMetaModule is
the meta-module (not shown here). In this example, the 3 methods new(), method1()
and method3() are modified due to the MOP.
These methods become *reflective* methods. When a user of MyBaseModule calls
one of these methods, they are not called directly, but the
method meta_method_call() of MyMetaModule is called instead. This method is passed
the original arguments of the method call, prepended by the (base level) method name and
(base level) object reference or package name used.
Hence, if a programmer does:
use MyBaseModule;
my $obj = MyBaseModule->new($newarg);
$obj->method1($foo, $bar);
$obj->method2($bur);
$obj->method3();
In fact, the actual operations taking place correspond to the following steps.
=over 4
=item 1.
`$obj = MyMetaModule->meta_method_call(new_Refl, 'MyBaseModule', $newarg)'
This occurs in place of the first call, as MyMetaModule is registered as the
meta-module of MyBaseModule.
=back
Then, supposing that at the end of this strange new() a meta-object
referenced by $metaobj is registered for the freshly created $obj, the processing
will continue as in the following.
=over 4
=item 2.
$metaobj->meta_method_call(*method1_Refl*, $obj, $foo, $bar)
This is the call of a reflective method on $obj and such calls are
processed by the meta-object, not by perl itself directly (even though
Perl behavior remains valid somewhere else).
=item 3.
$obj->method2($bur)
This is a normal method call. As method2() is *not* reflective, the
work is done by perl itself.
=item 4.
$metaobj->meta_method_call(*method2_Refl*, $obj)
Again, a reflective method call to finish.
=back
*Note*: Here, even if they are actually used, the *blabla_Refl* names are only for
illustration. They represent the
name of the base level method. The meta-object needs them if it ever wants
the real work to be done. But note that the structure of these names may not follow
this scheme indefinitely (and these thingies may become code references in the future).
See  meta_handle_method_call() in MOP::MetaModule.
A MOP is mainly useful for modules that provide a rather strict
object-oriented interface. It allows to extend transparently the functionality
provided by such a class module in order to provide additional
properties not directly related to the module functions. This may sound rather
obscure, but it can really be useful.
For example, this is the case in the real world when you want to add transparent
distribution to your programs, when you want to enhance such distributed execution
with a CRC integrity check in messages, when you want to manage multiple replicas
of a server, etc.

Alternatives

Package Version Architecture Repository
perl-MOP - - -

Requires

Name Value
/usr/share/perl5 -
perl(B.pm) -
perl(Devel/Hook.pm) -
perl(Devel/OverloadInfo.pm) -
perl(Scalar/Util.pm) -
perl(Sub/Metadata.pm) -
perl(Sub/Util.pm) -
perl(Symbol.pm) -
perl(UNIVERSAL/Object/Immutable.pm) -
perl(attributes.pm) -
perl(mro.pm) -
perl(parent.pm) -
perl-base >= 1:5.10.0
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(MOP.pm) = 0.140
perl(MOP/Class.pm) = 0.140
perl(MOP/Internal/Util.pm) = 0.140
perl(MOP/Method.pm) = 0.140
perl(MOP/Method/Attribute.pm) = 0.140
perl(MOP/Role.pm) = 0.140
perl(MOP/Slot.pm) = 0.140
perl(MOP/Slot/Initializer.pm) = 0.140
perl(MOP/Util.pm) = 0.140
perl-MOP = 1:0.14-alt2

Download

Type URL
Mirror ftp.altlinux.org
Binary Package perl-MOP-0.14-alt2.noarch.rpm
Source Package perl-MOP-0.14-alt2.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-MOP rpm package:
    # sudo apt-get install perl-MOP

Files

Path
/usr/share/doc/perl-MOP-0.14/Changes
/usr/share/doc/perl-MOP-0.14/LICENSE
/usr/share/doc/perl-MOP-0.14/README
/usr/share/doc/perl-MOP-0.14/README.md
/usr/share/perl5/MOP.pm
/usr/share/perl5/MOP/Class.pm
/usr/share/perl5/MOP/Method.pm
/usr/share/perl5/MOP/Role.pm
/usr/share/perl5/MOP/Slot.pm
/usr/share/perl5/MOP/Util.pm
/usr/share/perl5/MOP/Internal/Util.pm
/usr/share/perl5/MOP/Method/Attribute.pm
/usr/share/perl5/MOP/Slot/Initializer.pm

See Also

Package Description
perl-MOP4Import-Declare-0.004-alt1.noarch.rpm Thin Meta-Object Protocol to build extensible exporters
perl-MP3-Album-0.14-alt1.noarch.rpm perl module MP3-Album
perl-MP3-CreateInlayCard-0.06-alt1.noarch.rpm create a CD inlay label for a directory of MP3 files
perl-MP3-Daemon-0.63-alt1.noarch.rpm a daemon that possesses mpg123
perl-MP3-Daemon-scripts-0.63-alt1.noarch.rpm MP3-Daemon scripts
perl-MP3-Find-0.07-alt3_8.noarch.rpm File::Find-based backend to MP3::Find
perl-MP3-ID3v1Tag-1.11-alt2_8.noarch.rpm Edit ID3v1 Tags from an Audio MPEG Layer 3
perl-MP3-Icecast-0.02-alt1.noarch.rpm perl module MP3-Icecast
perl-MP3-Icecast-Simple-0.2-alt1.noarch.rpm perl module MP3-Icecast-Simple
perl-MP3-M3U-0.01-alt1.noarch.rpm perl module MP3-M3U
perl-MP3-M3U-Parser-2.33-alt1.noarch.rpm MP3 playlist parser
perl-MP3-Merge-1.01-alt1.noarch.rpm MP3 files merger and streamer to web browser
perl-MP3-PodcastFetch-1.05-alt1.noarch.rpm This is a library of tools for managing podcast subscriptions. It comes with a command-line tool, f
perl-MP3-PodcastFetch-scripts-1.05-alt1.noarch.rpm MP3-PodcastFetch scripts
perl-MP3-Splitter-0.04-alt1.noarch.rpm Perl extension for splitting MP3 files
Advertisement
Advertisement