in reply to Sort alphabetically from file
TIMTOWTDI but here is one to get your teeth into.
#!/usr/bin/env perl use strict; use warnings; print sort { ($a =~ /\S+\n$/g)[0] cmp ($b =~ /\S+\n$/g)[0] } <DATA> __DATA__ 1 2 3 delta 1 2 3 apricot 1 2 3 charlie 1 2 3 bravo 1 2 3 echo 1 2 3 fox
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Sort alphabetically from file
by edujs7 (Novice) on Jun 14, 2019 at 14:43 UTC | |
by BillKSmith (Monsignor) on Jun 14, 2019 at 15:54 UTC | |
by hippo (Bishop) on Jun 14, 2019 at 15:12 UTC | |
by edujs7 (Novice) on Jun 15, 2019 at 09:49 UTC |
In Section
Seekers of Perl Wisdom