Subject: | Hybrid get/set methods |
It'd be great if Class::XCAccessor could create a (fast :) method that's
the equivalent of this:
sub foo
{
return $_[0]->{'foo'} = $_[1] if(@_ > 1);
return $_[0]->{'foo'};
}
That is, a single method that acts as a mutator if an argument is
passed, and an accessor otherwise.