I know you just copied the OP, but return \%hash; should be just \%hash.
His return $item{"expr(s)"} should be just $item{"expr(s)"}.
P::RD actions (i.e. code blocks in curlies) are placed in a do, not a sub. Since return shouldn't be used to exit a do, return shouldn't be used to exit a P::RD action.
In reply to Re^2: How do I return a hash from Parse::RecDescent?
by ikegami
in thread How do I return a hash from Parse::RecDescent?
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |