in reply to Re^2: Sorting Issue
in thread Sorting Issue

$status=~s/P|F|C|D|I/Posted/g; $status=~s/A/Accepted/g; $status=~s/N/New/g; $status=~s/R/Rejected/g; $status=~s/S/Save/g; $status=~s/X/Canceled/g; my @strings = split /\|/, $status; my @sorted_strings = sort @strings; print "<br><font color=red>@sorted_strings</font><br>";

Update: If there is for each record status is only one letter, then I misunderstood string 'P|F|C|D|I|A|N|R|S|X' and '|' stands for 'or'. In such case see blazar's post.

Replies are listed 'Best First'.
Re^4: Sorting Issue
by blazar (Canon) on Jul 26, 2005 at 14:18 UTC
    Update: If there is for each record status is only one letter, then I misunderstood string 'P|F|C|D|I|A|N|R|S|X' and '|' stands for 'or'. In such case see blazar's post.
    And if so the example code I provided there could be further simplified: no substituion at all should be necessary. Just hash lookup.