in reply to Perl array output sorting

I think you are looking for push instead of print.

push @newarray,"$command -mdb $db"
Though I don't understand what it has to do with "sorting" (?) Otherwise plz rephrase your question.

And please put your data also in code tags!!!

(it's almost unreadable now. =)

Cheers Rolf

( addicted to the Perl Programming Language)