in reply to Re^4: Sorting by value??
in thread Sorting by value??

Once you fix the problem that was explained by ahmad above, you will discover the next problem with your code: now all the "if" conditions will come out false every time, because...
... $frmType = substr $_, 1, 3; if ($frmType eq "M729") { ...
The "substr()" call is assigning a 3-character string to $frmtype, and you are testing that to see if it's identical to a 4-character string ("M729" in this case). That makes no sense.

Also, proper indentation would help a lot. Please give that a try.