in reply to Deleting EOF from a file

AFAIK EOF is only a character on Win32/DOS systems (well, in files that is), and can be removed like this (I had to google for the EOF charnum, but it seems to be 032):
perl -pn -i.bak -e 's/\032//g' filename
This is completely untested