Sara wrote: > Yep, I did that, tried every single option to remove this premature end of > script headers. > > Do you think it has to do something with 'gedit' text editor? because I am > scripting in this editor for the very first time. > The scripts copied from Window XP machine have no problems at all, runing > smoothly, only those are producing error which I am writing in the Linux > machine. Why? > > use CGI qw(&header); > use CGI::Carp qw(fatalsToBrowser); > > > print &header; > print "Hello world";
this looks fine. you should lose the '&' sign because you are passing @_ to header implicitly. > > > ----------------- > > with CGI.pm > > $q->print($q->header( type => 'text/html') not sure where you declare $q so i am not going to comment on it. > > -------------- > > and simply > > print "Content-Type: text/html\n"; > > print "Hello World\n"; > this is wrong. see Drieux's previous message for reason. chances are that when you move (you said you copied the script from a windows xp machine and then work on it in gedit?) the script from windows to linux, your script is carrying over the \r character. gedit won't show that to you. try: [panda]$ head -1 script.cgi | od -c and see if you see any '\r' character anywhere. if you do, that's probably the cause of the problem. remove those characters with: [panda]$ perl -i -pe 's/\r//' script.cgi and then run your script again. david -- $_=q,015001450154015401570040016701570162015401440041,,*,=*|=*_,split+local$"; map{~$_&1&&{$,<<=1,[EMAIL PROTECTED]||3])=>~}}0..s~.~~g-1;*_=*#, goto=>print+eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]