Don't know why you get nothing when you print outside the loop, but I can answer why you get repeating values within.
With each iteration, you are pushing the newest file to the @files array, then printing out the contents of the entire array. So on the first iteration, you print out the first file, on the second you print out both the first and the second files, on the third you print out all three files, etc. Just print out $receivefile to get no repeats in your output.
-----
Be bloody, bold, and resolute; laugh to scorn
The power of man...