in reply to criteria based array sorting

Update: Originally solved the wrong problem. This version may be computationally simple enough that the ST suggested by others is unnecessary.
print sort { if (($a=~/^[a-z]/) == ($b=~/^[a-z]/)) { $a cmp $b } else { $b cmp $a } } @needs_sorting;
If the initial letters are the same case, sort normally
If not, sort reverse (putting the lower first).

Further update: I liked Broquaint's way of checking initial case.


The PerlMonk tr/// Advocate