#!/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
In reply to Re^3: split chars in string
by zwon
in thread split chars in string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |