in reply to Re^2: split chars in string
in thread split chars in string
#!/usr/bin/perl use strict; use warnings; use 5.010; chomp( my @words = <DATA> ); @words = sort { substr( $a, 1, 1 ) cmp substr( $b, 1, 1 ) } @words; say for @words; __DATA__ How about sorting an array of words by the second character every word
|
|---|