in reply to sorting an array

This'll do it with two lines and a sideways leap:
my $array = join(",",@array); my @newarray = ($array =~ /\*\*\*\d+\*\*\*,(.*?),\*\*\*end\d+\*\*\*/g);
(I know that's three lines, but that's the way the monk wraps) (shd that be raps?)

If you want the delimiters, ***1*** etc, to be part of the new elements, then leave the ()s out of the regex. Enjoy!, as they say.

§ George Sherston