use strict;
Foo::bar();
package Foo;
use Carp qw(croak);
sub bar {
baz(one => 'uno', two => 'dos', three => );
}
sub baz {
croak "wrong number of arguments for baz(); has to be even" if sca
+lar(@_) % 2;
my %args = @_;
print "func: one translates to $args{one} \n";
}
__END__
wrong number of arguments for baz(); has to be even at - line 2
Seems like more typing for a worse result to me. Oh, and if you rename your function, you have to synchronize the function with the error message. A little laziness on that part could lead to all sorts of puzzlement.