Contracts in Perl 'Class::Agreement' #32

Example 4

invariant sub {
    my ( $self ) = @_;
    return ( $self->pieces >= 4 
        and $self->pieces <= 64 );
};
Copyright © 2005 Ian Langworth