port Perl 5.6.2 build stuff from travis-experiments branch