if (ref $args eq "HASH") { while(my ($method, $value) = each %$args) { if (my $func = $self->can($method)) { $func->($self, $value); # Update: I think in this case (after # consulting in CB and in the docs # regarding lvalue subs) it should be: # $func->($self) = $value } } }