develooper Front page | perl.moose | Postings from February 2009

Chained Mutators?

Thread Next
From:
Terrence Brannon
Date:
February 11, 2009 16:57
Subject:
Chained Mutators?
Message ID:
499372F8.7040006@gmail.com
I would like to be able to do this with a Moose object:
package Doc;

use Mouse;
has 'body' => (is => 'rw');
has 'hdr' => (is => 'rw');
has 'ftr' => (is => 'rw');

1;

my $m = Doc->new;
$m->body(12)->hdr->(14)->ftr(5);


Is this possible?


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About