in reply to Avoiding user-input in sub calls.
You may be interested in CGI::Application as it looks like it fits in to how you're trying to structure you application.