in reply to how to declare a local *subname=sub{}?
Your code and questions reveal a fundamental misunderstanding of local.
Cheers Rolf (addicted to the Perl Programming Language and ☆☆☆☆ :) Je suis Charlie!