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.
accessors (Score:1)
This is the reason I am leaning more and more towards Class::Accessor and similiar. I note that you'd have to override set() to return $self that way, however.
-Dom
Reply to This
Re:accessors (Score:1)
> that before. This is a more general code issue,
> and it's probably fine for your small code, but
> what happens if you want to store undef in your
> accessor?
Generally I work very hard to make sure I never need to have an undef in any given state
The object in question will always be in one of two states:
Cases can be made for wanting to
Re:accessors (Score:2)
I usually write something like
which gives you the ability to set something to undef but doesn't let you chain method calls. If you wanted to chain method calls, you could instead write it this way
Now I'm just being silly... (Score:2)