Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-08-2003, 01:09 AM   #1
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
PERL premature end of script ASCII question

I've figured out that the only thing that could possibly be wrong with my CGI is that I must have copied it into the directory in non-ASCII (I edited the script on a windows machine).

Normally people FTP the script into the network with ASCII conversion, but I haven't hooked the web server up yet, and am just doing this through floppy disk.

The question:- Is there any program to convert a document from whatever-it-was to ASCII within Linux? that would be helpful.
Old 08-08-2003, 07:25 AM   #2
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
"dos2unix" or open the file in vi, then type w/o quotes ":se ff=unix" enter, type ":wq" to close and save.
Old 08-08-2003, 09:06 AM   #3
Registered: Aug 2002
Posts: 16,034

Rep: Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853Reputation: 1853
What do you mean by non-ASCII? If you used notepad then the above post will work. If you used wordpad or word and saved it as a text document then again the above post will work.

If it is a word document then maybe openoffice or staroffice will convert it from a word document to a text document. If that doesn't work then you will need to go back and save the file as a text document on the windows PC and then convert using the above post.

The difference between a linux ASCII text file and a DOS ASCII text file is that DOS uses both a carriage return and line feed character i.e. 0x0A, 0x0D and linux just uses 0x0A. Thats why you will see a ^M on the end of each line if you open up a DOS text file in linux.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Premature end of script headers bhomass Debian 1 12-02-2005 05:31 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
Premature end of script headers webhead Red Hat 5 09-22-2004 01:56 AM
Perl/CGI Problem "Premature Premature end of script headers:" newuser455 Linux - Software 2 07-18-2004 11:47 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration