texuser74,
If you take a look at perldoc perlvar you will find plenty of interesting variables to make you life easier. In this case, I used $/ - the input record seperator.
$/ = "<sep>\n";
while ( <DATA> ) {
chomp;
print "$_\n" for sort { $a <=> $b } split /\n/;
print $/ if ! eof DATA;
}