I'd actually prefer separate get/set methods, in a case like this. It's probably just me, but I'd like to be able to pass a list of parameter names to CGI::param() and get back their values.
If I were to do this, I'd probably do just a bit more to make it obvious:
sub method {
my ($self, $i) = @_;
if (@_ > 2) {
$self->{B}[$i] = $_[2];
}
return $self->{B}[$i];
}