NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Object::Tiny accessors are read-only (Score:1)
Unfortunately, Object::Tiny accessors are read-only.
So there's one little thing that Class::Accessor has over Object::Tiny. (For about 30 seconds until Adam goes and adds it.)
Otherwise, Object::Tiny++
Re: (Score:1)
Frankly, I don't get this obsession people have with mutators.
90% of the time, you want to make a data object of some sort with the attributes fixed at create-time.
90% of the time, it makes little to no sense to have values changing after the object is created.
This sort of thing is silly.
my $object = Foo->new;
$object->param1('foo');
$object->param2('bar');
It leaves the code in a transitional state that may will be illegal.
FAR better to just provide it to the constructor, en
Re: (Score:1)
It’s not like it’s hard to write them manually. What O::T provides is just a simple hash-bashed object after all.
Re:Object::Tiny accessors are read-only (Score:1)
Reply to This
Parent
Re: (Score:2)