print <<"ending_print_tag"; 
Author Message
 print <<"ending_print_tag";

Heya...

I am new to perl so bare with me...
I have a problem with -
print <<"ending_print_tag";

Say I do -

------------------------------------

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<"ending_print_tag";
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
ending_print_tag

------------------------------------

I get the following error -

  "The server encountered an internal error and was unable to complete
your request.

     Error message:
Premature end of script headers: firstCGI.pl"

Why??? Please help, it's weird.
I have done chmod a+x /var/www/html/daves/perl/file.pl
still no good. If I change it to -

------------------------------------

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>";

------------------------------------
It runs fine!

My system is running Linux Red Hat 8.0, apache 2.0.40, perl 5.8.0.

Any help would be GREATFULLY appreciated. Thanks
(sorry this is a long post!)

...Dave...



Sun, 23 Oct 2005 17:29:54 GMT  
 print <<"ending_print_tag";

Quote:

> Heya...

> I am new to perl so bare with me...
> I have a problem with -
> print <<"ending_print_tag";

> Say I do -

> ------------------------------------

> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print <<"ending_print_tag";
> <html>
> <head>
> <title>Hello World</title>
> </head>
> <body>
> <h1>Hello World</h1>
> </body>
> </html>
> ending_print_tag

> ------------------------------------

> I get the following error -

>   "The server encountered an internal error and was unable to complete
> your request.

>      Error message:
> Premature end of script headers: firstCGI.pl"

> Why??? Please help, it's weird.

Please consult you your web servers error log to see the Perl error as
opposed to the CGI protocol error.

Random shot in the dark - there's no end of line character on the last
line of the script.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Sun, 23 Oct 2005 17:45:32 GMT  
 print <<"ending_print_tag";

Quote:


>>Heya...

>>I am new to perl so bare with me...
>>I have a problem with -
>>print <<"ending_print_tag";

>>Say I do -

>>------------------------------------

>>#!/usr/bin/perl
>>print "Content-type: text/html\n\n";
>>print <<"ending_print_tag";
>><html>
>><head>
>><title>Hello World</title>
>></head>
>><body>
>><h1>Hello World</h1>
>></body>
>></html>
>>ending_print_tag

>>------------------------------------

>>I get the following error -

>>  "The server encountered an internal error and was unable to complete
>>your request.

>>     Error message:
>>Premature end of script headers: firstCGI.pl"

>>Why??? Please help, it's weird.

> Please consult you your web servers error log to see the Perl error as
> opposed to the CGI protocol error.

> Random shot in the dark - there's no end of line character on the last
> line of the script.

Heya...

Thanks for that, the new line cured it, but when i took it away to
check... it worked still :-/ very weird! Thanks for your help.

...Dave...



Sun, 23 Oct 2005 18:13:36 GMT  
 print <<"ending_print_tag";

Quote:
> Heya...

> . . . bare with me...

Whoa there!  I don't think so.  I'm a happily married man AND this is a
public forum.
Tsk, tsk.              ;-}


Mon, 24 Oct 2005 09:51:35 GMT  
 print <<"ending_print_tag";
Quote:



>>Heya...

>>. . . bare with me...

> Whoa there!  I don't think so.  I'm a happily married man AND this is a
> public forum.
> Tsk, tsk.              ;-}

Ookaaaayyyyy.... you know I didn't mean that :-p


Mon, 24 Oct 2005 13:49:54 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. print <<"EOF";

2. ^<<<<<<<<<<<~~ with \n

3. <<ENFofFTP "here-documnet" question

4. ^<<<<<<<<<<< ~~ format question

5. How to "$block_of_text<<"EOT" while "use strict"?

6. print "</tr><tr>" vs. print $tr

7. efficiency: print<<"xxx" vs. print

8. How can I make @<<<<<<<<< variable ?

9. Tcl "exec" construct with "<<", in Perl

10. How can grep the 8th of Field <<<<<<<<

11. Question on Cutting and Paste things in a File <<<<<<<<

 

 
Powered by phpBB® Forum Software