in reply to XP messing up my CGI files

Probably not a perl or an XP problem, but one of two things - your FTP client is transferring the files in binary mode (like others say above) or you need to chmod the file so it can be executed. Your FTP client is probably capable of doing both.

Detailed instructions (plus many other CGI troubleshooting tips _if_ my guess is wrong) can be found here or either of the links atcroft mentioned above.