in reply to Sorting Strings By Vowel Sequence

You can use Sort::Key.

If you have a recent perl (>= 5.14):

use 5.14; use Sort::Key qw(keysort); my @sorted = keysort { s/[^aeiou]+//gr } @data;

Otherwise:

use Sort::Key qw(keysort); my @sorted = keysort { join '', /[aeiou]+/g } @data;

Or in pure perl, just build a hash with the sorting keys:

my %keys; $key{$_} = s/[^aeiou]+//gr for @data; my @sorted = sort { $key{$a} cmp $key{$b} } @data;

The ST is an overrated technique, but quite popular because learning it is like some kind of initiation ritual into the realms of intermediate Perl. In practice, in only works for datasets that are not too big because it uses too much memory.