http://www.perlmonks.org?node_id=79094


in reply to sorting based on a list

I would suggest using a hash for that. You can then sort the hash or pull the words out by letter.
my %foo = { 'a' => 'alpha', 'b' => 'bravo', 'c' => 'charlie'}; foreach $x (sort(keys(%foo))) { print $foo{$x}\n; } print $foo{'b'},$foo{'a'},$foo{'c'};


------
The Price of Freedom is Eternal Vigilance