in reply to
Re: Preferred technique for named subroutine parameters?
in thread Preferred technique for named subroutine parameters?
That's because you are doing it wrong. Carp is your friend:
use warnings;
use strict;
use Carp;
func(one => 'uno', two => 'dos', three => );
sub func {
croak "wrong number of arguments for func(); has to be even" if sc
+alar(@_) % 2;
my %args = @_;
print "func: one translates to $args{one} \n";
}
prints
wrong number of arguments for func(); has to be even at a.pl line 8
main::func('one', 'uno', 'two', 'dos', 'three') called at a.pl lin
+e 5