should use curly braces (indicating that $hash is a reference to a hash), not parentheses (indicating that $hash is a reference to a function).$value = $href->($key);
The line in question tries to call a subroutine referenced by $hash, hence the error message.
In reply to Re: error when passing hash as reference causes
by dmitri
in thread error when passing hash as reference causes
by ccarden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |