++ed by:
1 non-PAUSE user
Author image James A. Duncan
and 1 contributors


EO - A generic base class


    package Some::Package
    use EO;

    use base qw(EO);

    sub init {
      my $self = shift;

      if ($self->SUPER::init( @_ ) {
        # .. perform initilisation
        return 1;

      return 0;


This is a base class for the EO module tree. EO is designed to be a well tested, solid, simple, and long living base class that other modules can rely on. EO inherits from Class::Accessor::Chained, and anything that inherits from it can easily create its get/set methods. For more information see the documentation from Class::Accessor::Chained.



The constructor takes no arguments and will call the init method. The programmer should ensure that the init method in turn calls its SUPER::init method. If the EO init method is not called then a warning will be issued to the effect. Furthermore the init method should return true to the constructor. Your init method should probably look something like this:

  sub init {
    my $self = shift;
    if ($self->SUPER::init( @_ )) {
      # ... perform initialisation ...
      return 1;
    return 0;

This will ensure that the initialisation occurs all the way up the parent-class chain.



Returns the object id of this object. Object id's are UUIDs as created by the Data::UUID module.


Returns a new object id.


The clone method is creates a copy of the object and returns it. This is the only method that should be used for cloning in order to refrain from preserving id's. The clone method guarantees that all objects contained within an object that respond true to ->isa('EO') will have their id's regenerated.


Provides stringification. Note -- this is not currently overloaded, but probably should be considered.



The Abstract attribute can be assigned to any method. When it is assigned it will cause any attempt to call that method to throw an EO::Error::Method::Abstract exception. This will happen at runtime.


The Private attribute can be assigned to any method. Any attempt to call this method from outside the package it is defined in will cause an EO::Error::Method::Private exception to be thrown. This will happen at runtime.



This exception is thrown whenever the constructor fails to successfully initialise an object. This usually occurs when the init() method does not return a true value.


This exception is thrown whenever a message sent to an object cannot be successfully sent.


This exception is thrown whenever there is a method call on a method marked with the Abstract attribute.


This exception is thrown whenever there is a method call from outside the defining package on a method marked with the Private attribute.


This exception is throw whenever the a message is sent to an object with incorrect parameters.


Arthur Bergman <abergman@fotango.com> James A. Duncan <jduncan@fotango.com>


Copyright 2004 Fotango Ltd. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


perl(1), Data::UUID(3)

1 POD Error

The following errors were encountered while parsing the POD:

Around line 241:

You forgot a '=back' before '=head1'