$self->test('database'); and $self->test(database => 'name.db'); sub test { my ($self,---) = @_; my %arg = ---- if (--- eq 'HASH'); this obviously doesn't work, but how to make it work !!! } $self->test(database => 'T'); is something i would like to avoid