fix compatibility issues with perl 5.12