You need to make your own custom sorting routine. Try something along the lines of:
# Note that $a and $b are special globals. DO NOT my THEM!!!
sub my_sort
{
my ($a_word, $a_num) = $a =~ /^(\w+)(\d+)$/;
my ($b_word, $b_num) = $b =~ /^(\w+)(\d+)$/;
return $a_word cmp $b_word || $a_num <=> $b_num;
}
foreach my $file (sort my_sort keys %hash)
{
print $key, $/;
}
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.