Right off the bat, go read How (Not) To Ask A Question. Having said that:
- that's not valid Perl so you haven't given anyone a decent idea of what exactly your data looks like
- Read the docs on split (paying special attention to the fact that it takes a regular expression and keeping in mind that | is a special character inside a regex) and sort, and also search for "How do I sort an array by (anything)?" in "perldoc perlfaq4".
The cake is a lie.
The cake is a lie.
The cake is a lie.