in reply to Sort alphabetically from file
#!/usr/bin/perl # https://perlmonks.org/?node_id=11101345 use strict; use warnings; print sort { $a =~ s/[\s\d]*//r cmp $b =~ s///r } <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 AnomalousMonk (Archbishop) on Jun 22, 2019 at 02:41 UTC |
In Section
Seekers of Perl Wisdom