use strict; my %hDat; my $d; my $n; map( ($hDat{lc $_ . $n++} = $_), ); foreach $d (sort keys %hDat) { print $hDat{$d}; } __DATA__ a B c D E Aa Xx A