I've prepared a Dockerfile that produces a canned Perl 5.8.8 environment based on CentOS 5 on any host with Docker. It has ccache installed and enabled, git installed, IPC::Run installed, all the mess required to make CPAN work sensibly done, etc.
That one didn't include a new enough flex or bison, so it couldn't rebuild a fully clean tree that hadn't been built on the host first.
Fixed in the attached along with some other cleanups.