"($ref(@records)->{ven})"
You realize that
- $ref(@records) is using round brackets which indicate a subroutine call,
- you cannot call a subroutine on a CODEREF that way if that was what you are trying to do (it would be $ref->(@records)),
- and that it won't actually evaluate to a subroutine call inside quotes.
I think you need to explain some more.
Makeshifts last the longest.