lower Perl dep to 5.8.1
fix test cases for old versions of Perl