Changes for version 1.5.0

  • 2.0_04 backported as 1.5.0.

Changes for version 2.0_04

  • New feature: You can now do chained accessors by using the -chained use option. Example:
    • package Person; use Class::Dot qw(-new -chained :std);
    • property name => isa_String; property email => isa_String; property age => isa_Int;
    • package main;
    • my $person = Person->new() ->set_name('Ask') ->set_email('asksh@cpan.org') ->set_age(25);

Changes for version 2.0_03

  • New and more readable SYNOPSIS.
  • A perl.vim syntax highlighting file for vim that also highlights 'property' in contrib/vim/syntax. Read contrib/vim/README for more information.
  • Types separated from Class::Dot and moved into Class::Dot::Types.

Changes for version 2.0_02

  • License changed to the Modified BSD license, however if you ask me nicely I might give you permission to use it with another license.
  • Now using Module::Install instead of Module::Build. (there was problems with using version::qv with M::B).
  • New test script to make sure we are compatible with older perls. (Right now we try to make it work with perl 5.6.0, but if we like something that is not supported in 5.6.0 we will leave it for 5.8.1).
  • Had to move ./Build wikidoc functionality into it's own script. (Since we're not using Module::Build anymore).
  • I've started signing the distribution with my PGP key.
  • Bumped the META version we ensure specification for to 1.3. (was 1.2).
  • Changed to BSD license.

Changes for version 2.0_01

  • Code cleanup.
  • Class::Dot now installs new methods to the object it creates:
    • __setattr__($self, $attribute_name, $value):
    • Set a object attribute. This is great for those times when you want to do this:
      • my %some_default_values = ( 'foo' => 'bar', 'bar' => 'baz', 'xuzzy' => 'fuzzy', );
      • while (my ($attr_name, $attr_value) = each %some_default_values) { my $set_attribute = 'set_' . $attr_name; if ($object->can($set_attribute)) { $object->$set_attribute( $attr_value ); } }
    • This isn't very pretty, so that's why you now can do this:
      • while (my ($attr_name, $attr_value) = each %some_default_values) { $object->__setattr__($attr_name, $attr_value); }
    • $val = __getattr__($self, $attribute_name)
    • Get an attributes value.
    • $bool = __hasattr__($self, $attribute_name)
    • Returns true if $self has the attribute $attribute_name.
  • Now you can't do this anymore;
    • $object->{attribute} = $value;
  • because now the attributes are better hidden in the object's hash. You can probably find out how they are saved by doing keys %{ $object }, but we _recommend against accessing that hash directly_!.
  • Now you can override properties simply by writing;
    • property name => isa_String('foo');
    • sub name { my ($self) = @_; warn 'Accessing name property'; return $self->__getattr__('name'); }
    • sub set_name { my ($self, $new_name) = @_; warn $self->__getattr__('name') . " is changing name to $new_name"; $self->__setattr__('name', $new_name); return; }
  • instead of using after_property_get() and after_property_set().
  • (Note: Just be sure not to use property() in a BEGIN block, you have to use after_property_* to do that!)

Modules

Simple and fast properties for Perl 5.
Functions returning default values for Class::Dot types.
perltags with support for Class::Dot
class representing a perltags property tag.