Your columns are kind of consistent:
Basically, all your lines matchmy @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' );
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 ':'./^(\d+ )?(\D+) (\d+):(\d+)$/.
Hope this helps,,,#!/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
Aziz,,,
In reply to Re: Inconsistent column Schwartzian Transform attempt
by abstracts
in thread Inconsistent column Schwartzian Transform attempt
by gryphon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |