in reply to writing an array of data to a file

heh... your while loop is un-necessary and wrong in this case. You would generally only have a loop like that if you were reading from a file. All you need in this case is something like:
for (@rows) { print OUTPUTFILE "$_\n"; }
(assuming that you want a newline after each element of @rows)

Cheers,
Darren :)