in reply to basic question:how to print a reversed array from STDIN
You also may try the following funny onliner script
perl -pe '$\=$_.$\}{' [download]
Yes, it prints reversed array of lines from STDIN