in reply to
Creating A Dynamic Subroutine
Answering your direct question, pass a reference. To deal with the database issue, perhaps an idea from
this article
may help?
Comment on
Re: Creating A Dynamic Subroutine
In Section
Seekers of Perl Wisdom