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 scalar(@_) % 2; my %args = @_; print "func: one translates to $args{one} \n"; } #### 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 line 5