Ask a Question related to PERL Beginners, Design and Development.
-
Nino V #1
malformed header
Hi,
I'm trying my first perl script on a Unix server, but without any success!
The script (codice.pl) is something like this:
#!/usr/bin/perl
$home="/home/dominio/public_html";
print "Home $home";
when I run it, I get this error:
malformed header from script. Bad header=Home /home/dominio/public_:
/home/dominio/public_html/cgi-bin/codice.pl
Can someone help me to understand where I'm wrong?
Thanks very much,
Nino
=================================
[url]http://www.vessella.it[/url] (italiano, esperanto, kiswahili, english)
[url]http://www.changamano.org[/url] (Iniziative di solidarietà per la Tanzania)
Corso di lingua swahili: [url]http://corsoswahili.vessella.net[/url]
Corso di lingua esperanto: [url]http://esperanto.vessella.net[/url]
Jifunze lugha ya Kiesperanto: [url]http://kiesperanto.vessella.net[/url]
Kamusi/Vortaro: [url]http://kamusi.vessella.net[/url]
Vocabolario esperanto-italiano: [url]http://vortaro.vessella.net[/url]
Articoli di quotidiani della Tanzania: [url]http://habari.lernado.it[/url]
Nino V Guest
-
Malformed URL trying to place multimedia content
I create a blank ID document, and then try to place an swf file and get the error message "Download failed due to malformed URL". The same thing... -
Can't Update to 7.01 - malformed server response
I am trying to update the CF from 7.0.0 to the "ColdFusion MX 7 Updater (7.0.1) ". I go to CF Admin "System Information " and in Update File, I... -
HTTPService Fault: An XML element was malformed
I'm new to Flex and encountered this error. I have a datagrid that gets populated from an HTTP Service call.I traced it to find that it occurs only... -
Malformed Header from Script error (Error 500)
Hi! If i tried to view a php page that is located on my webserver, apache shows the error #500 and the error_log says: malformed header from... -
malformed url
I am sending email from apache using mail(). In the email I am sending a url. The url is rather long and consequently the email client is adding... -
Rob Hanson #2
RE: malformed header
The short answer...
Make sure this is the first print statement:
print "Content-type: text/html\n\n";
The long answer...
CGI scripts work by passing the web server a header part and a body part.
The header part must contain AT LEAST the content type of the document (e.g.
"text/plain", "text/html", etc). The header is then followed by a single
blank line, then comes the main body content for the page.
The web server takes your header info and adds some of it's own (or even
modifies yours). It them sends this page to the client (browser) in two
parts... header, followed by a blank line, then the body content (see HTTP
specs).
The print statement I game above includes the minimal header info, the
Content-type, as well as a single blank line. Anything after that statement
is taken by the web server as belonging to the body.
The error you recieved was because you never printed the header, only the
body, and the web server choked on it because it didn't make any sense (was
malformed).
Hope the helps.
Rob
-----Original Message-----
From: Nino V [mailto:nino@vessella.it]
Sent: Monday, October 13, 2003 1:49 PM
To: [email]beginners@perl.org[/email]
Subject: malformed header
Hi,
I'm trying my first perl script on a Unix server, but without any success!
The script (codice.pl) is something like this:
#!/usr/bin/perl
$home="/home/dominio/public_html";
print "Home $home";
when I run it, I get this error:
malformed header from script. Bad header=Home /home/dominio/public_:
/home/dominio/public_html/cgi-bin/codice.pl
Can someone help me to understand where I'm wrong?
Thanks very much,
Nino
=================================
[url]http://www.vessella.it[/url] (italiano, esperanto, kiswahili, english)
[url]http://www.changamano.org[/url] (Iniziative di solidarietà per la Tanzania)
Corso di lingua swahili: [url]http://corsoswahili.vessella.net[/url]
Corso di lingua esperanto: [url]http://esperanto.vessella.net[/url]
Jifunze lugha ya Kiesperanto: [url]http://kiesperanto.vessella.net[/url]
Kamusi/Vortaro: [url]http://kamusi.vessella.net[/url]
Vocabolario esperanto-italiano: [url]http://vortaro.vessella.net[/url]
Articoli di quotidiani della Tanzania: [url]http://habari.lernado.it[/url]
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Rob Hanson Guest
-
Nino V #3
R: malformed header
Hi, Rob!
You were right!
Thanks to you I've fixed the script.
Thanks a lot.
Ciao,
Nino
=================================
[url]http://www.vessella.it[/url] (italiano, esperanto, kiswahili, english)
[url]http://www.changamano.org[/url] (Iniziative di solidarietà per la Tanzania)
Corso di lingua swahili: [url]http://corsoswahili.vessella.net[/url]
Corso di lingua esperanto: [url]http://esperanto.vessella.net[/url]
Jifunze lugha ya Kiesperanto: [url]http://kiesperanto.vessella.net[/url]
Kamusi/Vortaro: [url]http://kamusi.vessella.net[/url]
Vocabolario esperanto-italiano: [url]http://vortaro.vessella.net[/url]
Articoli di quotidiani della Tanzania: [url]http://habari.lernado.it[/url]
Nino V Guest



Reply With Quote

