in reply to Dancer + cgi

You probably want to look at Dancer::Deployment which should guide you.