in reply to Inconsistent column Schwartzian Transform attempt

Hello

Your columns are kind of consistent:

my @unordered = ( '12 Corinthians 5:10', 'Hebrews 11:15', '1 Corinthians 13:23', '2 Corinthians 1:3', 'John 3:16', '1 Corinthians 12:10', '1 Corinthians 2:10', '1 Corinthians 2:10' );
Basically, all your lines match
/^(\d+ )?(\D+) (\d+):(\d+)$/.
Here is how it can be done assuming you want to sort by the first number, then by the word, then by the number before the ':', then finally by the number after the ':'.
#!/usr/bin/perl -w my @unordered = ( '12 Corinthians 5:10', 'Hebrews 11:15', '1 Corinthians 13:23', '2 Corinthians 1:3', 'John 3:16', '1 Corinthians 12:10', '1 Corinthians 2:10', '1 Corinthians 2:10' ); my @sorted = map { $_->[0] } sort { ($a->[1]||0) <=> ($b->[1]||0) || $a->[2] cmp $b->[2] || $a->[3] <=> $b->[3] || $a->[4] <=> $b->[4] } map { [$_, /^(\d+ )?([A-Za-z]+) (\d+):(\d+)$/] } @unordered; print "$_\n" for @sorted; # Hebrews 11:15 # John 3:16 # 1 Corinthians 2:10 # 1 Corinthians 2:10 # 1 Corinthians 12:10 # 1 Corinthians 13:23 # 2 Corinthians 1:3 # 12 Corinthians 5:10
Hope this helps,,,

Aziz,,,