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