in reply to Re: setting and retrieving sub-hash elements in an object
in thread setting and retrieving sub-hash elements in an object

Actually there is a way to avoid the explicit loop, but it is a little inefficient:
sub option { my $self = shift; if (1 == @_) { return $self->{option}->{ shift(@_) }; } else { %{$self->{option}} = (%{$self->{option}}, @_); } }
  • Comment on Re (tilly) 1: setting and retrieving sub-hash elements in an object
  • Download Code