View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
David Golden > Class-InsideOut > Class::InsideOut::Manual::About


Annotate this POD


View/Report Bugs


Class::InsideOut::Manual::About - guide to this and other implementations of the inside-out technique


version 1.14


This manual provides an overview of the inside-out technique and its application within Class::InsideOut and other modules. It also provides a list of references for further study.

Inside-out object basics

Inside-out objects use the blessed reference as an index into lexical data structures holding object properties, rather than using the blessed reference itself as a data structure.

  $self->{ name }        = "Larry"; # classic, hash-based object
  $name{ refaddr $self } = "Larry"; # inside-out

The inside-out approach offers three major benefits:

In exchange for these benefits, robust implementation of inside-out objects can be quite complex. Class::InsideOut manages that complexity.

Philosophy of Class::InsideOut

Class::InsideOut provides a set of tools for building safe inside-out classes with maximum flexibility.

It aims to offer minimal restrictions beyond those necessary for robustness of the inside-out technique. All capabilities necessary for robustness should be automatic. Anything that can be optional should be. The design should not introduce new restrictions unrelated to inside-out objects, such as attributes and CHECK blocks that cause problems for mod_perl or the use of source filters for syntactic sugar.

As a result, only a few things are mandatory:

All other implementation details, including constructors, initializers and class inheritance management are left to the user (though a very simple constructor is available as a convenience). This does requires some additional work, but maximizes freedom. Class::InsideOut is intended to be a base class providing only fundamental features. Subclasses of Class::InsideOut could be written that build upon it to provide particular styles of constructor, destructor and inheritance support.

Other modules on CPAN

References for further study

Much of the Perl community discussion of inside-out objects has taken place on Perlmonks ( My scratchpad there has a fairly comprehensive list of articles ( Some of the more informative articles include:



David Golden <>


This software is Copyright (c) 2006 by David A. Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
syntax highlighting: