Since migration from Perl to PHP is relatively painless, because they share many internals, I'd head down that route, even if you think the code is ugly. The fun part being that a PHP engine will understand a fair amount of Perl code without modification, and give you meaningful error messages when it hits the parts that it doesn't understand - and you can test the whole lot offline before committing yourself to online deployment. There's also reasonable debuggers available for PHP, if you have the right setup, some of which are almost as good as the in-built JavaScript debugger in Chrome.
There's still a lot of support for PHP, because a number of big organisations still use it.
I'd be a little wary of Python for web use at the moment, until it matures properly. The good news being that you can try out ideas offline in Python, because it's compiled, but it's an idiosyncratic language to get to grips with.
If, on the other hand, you don't mind getting your hands dirty with JavaScript, one way to go would be to try Node.js, which runs JavaScript code on the server side, and which I've been using effectively for full stack development now for 3 years. Be warned, the manual is terse and at times unforgiving! But if you persevere with it, it scales extremely well. Node.js also has the advantage that you can write your own web server to run under it, if you don't like any of the standard options, and you can integrate PHP with Node.js quite nicely (which I've done on my own development machine for code testing. The advantage being that Node.js debugging in Chrome is fully supported, and you can trace your code step by step in offline development, before committing yourself to production code.