\&func1
is a subroutine reference, but \&func1(\@arraydata)
is a reference to the value returned by a call to &func1. Try instead just: "ab 1" => \&func1, ...
. The passing of @arraydata is correct in your dispatch code.
Note that /$k/
will make metacharacters like . or * have their special effect in the regex; if you don't want that, do /\Q$k/
instead. Or possibly you want just eq $k
?