in reply to extra spaces in textarea

I can't reproduce your problem, but I have had something like it in the past. I think it is due to Perl separating the elements of the array with a space for viewing. Try this:

print foreach @ary;

You might also try slurping up the file into a big scalar instead of line-by-line into an array.

http://www.nodewarrior.org/chris/