in reply to sorting not sort

You seem to have some fundamental confusions. Your code, as is, does a descending numeric sort by the values in %strings, while what you are describing is an ascending mixed numeric/string sort of the keys.

To do the latter, you need to provide a lot more code to sort. Here's one way:

sub sortable_key { my $key = shift; # e.g. "E1,E10"; $key =~ s/(\d+)/ chr($1+0x1000000) /e; return $key; } print map { "$_ = $strings{$_}\n" } sort { sortable_key($a) cmp sortable_key($b) } keys %strings;