compatibility for perl 5.12 and below