add sorting for perl 5