in reply to Re: oop + named arguments
in thread oop + named arguments

japhy,
When I am doing this without using an existing wheel, it usually looks something like:
sub thing { my $self = shift @_; croak "Incorrect number of arguments" if @_ % 2; my %arg = @_; for (@known_args) { # handle $arg{$_}; delete $arg{$_}; } if (keys %arg) { my $bad = join ' ', keys %arg; croak "The following args are invalid: $bad"; } # ... remainder of thing }

Cheers - L~R