in reply to Sort Array

This is not a solution for your post, only a warning about your array - you won't be able to sort it as it is!

Please read carefully how davido builds @arr - he's using the qw (quote word) operator, differently from you that are using single quotes. In this way, you're actually putting only 1 element inside the array, that is one big string containing all the filenames separated by newlines. davido's approach, on the other side, lets you have an element in @arr for each filename that is compound of a single word (and this is fine in your case, because your filenames don't have spaces). Caveat emptor.

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

Don't fool yourself.