in reply to sorting mixed alpha_digit keys of a hash?

What you want to do is take each key name and split it into the letter half and the digit half, and use these as keys in a multi-dimensional hash:
my %data; for my $k (keys %form) { # assumes all the keys are non-numbers followed by numbers my ($letters, $numbers) = $k =~ /(\D+)(\d+)/; $data{$numbers}{$letter} = $form{$k}; }
Now your %data hash has the I, Q, P, and IT fields grouped by the number following them.

If you'd rather just sort the keys in this manner and not produce a whole new data structure, I suggest:

# UPDATE (fixed indices!) my @sorted_keys = map { $_->[0] } sort { $a->[2] <=> $b->[2] or $a->[1] cmp $b->[1] } map { [$_, /(\D+)(\d+)/] } keys %form;
This is a standard Schwartzian Transform.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart