MooseX::Method::Signatures MooseX::Method::Signatures - safety types in Perl #2

An example: Doc::Perlish

use Spiffy -Base;
field 'source';

sub _init {
    my $o = shift;
    $self->SUPER::_init($o);
    $self->source($o->{source}) if defined $o->{source};
}

sub new {
    my $class = ref $self || $self;
    $class ne __PACKAGE__ or croak "attempt to create a pure Node";
    super(@_);
}
Copyright © 2006 Catalyst IT (NZ) Ltd