Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

class::inner(3pm) [debian man page]

Class::Inner(3pm)					User Contributed Perl Documentation					 Class::Inner(3pm)

NAME
Class::Inner - A perlish implementation of Java like inner classes SYNOPSIS
use Class::Inner; my $object = Class::Inner->new( parent => 'ParentClass', methods => { method => sub { ... } }, }, constructor => 'new', args => [@constructor_args], ); DESCRIPTION
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent class's method. METHODS new HASH Takes a hash like argument list with the following keys. parent The name of the parent class. Note that you can only get single inheritance with this or SUPER won't work. methods A hash, keys are method names, values are CODEREFs. constructor The name of the constructor method. Defaults to 'new'. args An anonymous array of arguments to pass to the constructor. Defaults to an empty list. Returns an object in an 'anonymous' class which inherits from the parent class. This anonymous class has a couple of 'extra' methods: SUPER If you were to pass something like $obj = Class::Inner->new( parent => 'Parent', methods => { method => sub { ...; $self->SUPER::method(@_) } }, ); then "$self-"gt"SUPER::method" almost certainly wouldn't do what you expect, so we provide the "SUPER" method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full "SUPER::" functionality, but I'm working on it. DESTROY Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a "DESTROY" method that removes the class from the symbol table once it's finished with. If you need to override a parent's DESTROY method, adding a call to "Class::Inner::clean_symbol_table(ref $self)" to it. Do it at the end of the method or your other method calls won't work. clean_symbol_table The helper subroutine that DESTROY uses to remove the class from the symbol table. new_classname Returns a name for the next anonymous class. AUTHOR
Maintained by Arun Prasaad "<arunbear@cpan.org>" Copyright (c) 2001 by Piers Cawley <pdcawley@iterative-software.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as perl itself. Thanks to the Iterative Software people: Leon Brocard, Natalie Ford and Dave Cross. Also, this module was written initially for use in the PerlUnit project, AKA Test::Unit. Kudos to Christian Lemburg and the rest of that team. SEE ALSO
There are a million and one differen Class constructors available on CPAN, none of them does quite what I want, so I wrote this one to add to that population where hopefully it will live and thrive. BUGS
Bound to be some. Actually the "SUPER" method is a workaround for what I consider to be a bug in perl. perl v5.10.1 2009-11-21 Class::Inner(3pm)

Check Out this Related Man Page

Class::MOP::Method::Wrapped(3pm)			User Contributed Perl Documentation			  Class::MOP::Method::Wrapped(3pm)

NAME
Class::MOP::Method::Wrapped - Method Meta Object for methods with before/after/around modifiers VERSION
version 2.0603 DESCRIPTION
This is a Class::MOP::Method subclass which implements before, after, and around method modifiers. METHODS
Construction Class::MOP::Method::Wrapped->wrap($metamethod, %options) This is the constructor. It accepts a Class::MOP::Method object and a hash of options. The options are: o name The method name (without a package name). This will be taken from the provided Class::MOP::Method object if it is not provided. o package_name The package name for the method. This will be taken from the provided Class::MOP::Method object if it is not provided. o associated_metaclass An optional Class::MOP::Class object. This is the metaclass for the method's class. $metamethod->get_original_method This returns the Class::MOP::Method object that was passed to the constructor. $metamethod->add_before_modifier($code) $metamethod->add_after_modifier($code) $metamethod->add_around_modifier($code) These methods all take a subroutine reference and apply it as a modifier to the original method. $metamethod->before_modifiers $metamethod->after_modifiers $metamethod->around_modifiers These methods all return a list of subroutine references which are acting as the specified type of modifier. AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Class::MOP::Method::Wrapped(3pm)
Man Page