in reply to Problem with sorting numbers.

and I don't know where the extra characters come from at the end of the output
You aren't using warnings, are you? :) You may have one or more extra newlines at the end of your data, which get inserted as empty arrays.

You may consider skipping empty lines:

# From ikegami's code while (<DATA>) { chomp; push(@records, [ split(/\|/) ]) unless /^\s*$/; }

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.