Help for this page

Select Code to Download


  1. or download this
    package OO;
    use strict;
    use warnings;
    use Carp qw/croak/;
    
  2. or download this
    #--------------------------------------------------------------------
    #       The registry itself: storing all the data of your objects
    ...
    
    # Object => Class => Attribute
    
  3. or download this
    #--------------------------------------------------------------------
    #       inheritable constructor with generalized behaviour
    ...
    
            return $self;
    }
    
  4. or download this
    #--------------------------------------------------------------------
    #       Use these two methods to get and set members of your
    ...
    
            $Object{ $obj }{ $class }{ $field } = $value;
    }
    
  5. or download this
    #--------------------------------------------------------------------
    #       most important: DESTROY
    ...
    
            delete $Object{ $obj } #that's why the structure of the regist
    +ry was chosen like that
    }
    
  6. or download this
    #--------------------------------------------------------------------
    #       create_accessor class method to create simple accessor/mutator
    + methods
    ...
                    }
            }
    }
    
  7. or download this
    #--------------------------------------------------------------------
    #       debugging function/method (as you like it)
    ...
    }
    
    1;