Why the html part does not print in this perl script?
Hi guys i try to run this script but i get this error :
Code:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Undefined subroutine &main::HTMLGetRequest called at c:\inetpub\wwwroot\cgi-bin\jukebox2006\textchat\pop.pl line 22.
This is the way i call it:
http://localhost/cgi-bin/jukebox2006...p.pl?name=ID11
Could any one help me fix this error. I am run perl locally and using iis5 .Thanks
Code:
#!/usr/bin/perl
&HTMLGetRequest;
#these are the variable recived from the edit box.We declare them here
$fname=$rqpairs{"name"};
# Set Your Options:
$redirection = 0; # 1 = Yes; 0 = No
#Note:
# SONG LOCATIONS
#Defult Subroutines
&HTMLContentType;
print <<method;
<html>
<head>
<title> Music</title>
</head>
<frameset framespacing="0" border="0" rows="85,70,*" frameborder="0">
<frame name="top" scrolling="no" noresize target="middle" src="http://localhost/jukeboxwall.html">
<frameset cols="92,300,40%">
<frame name="middle" target="bottom" src="http://localhost/jukeboxwall.html" scrolling="no" noresize>
<frame name="middle1" src="http://localhost/textchat/popjukebox.pl?name=$fname" scrolling="no" noresize>
<frame name="middle2" src="http://localhost/jukeboxwall.html" scrolling="no" noresize>
</frameset>
<frame name="bottom" src="http://localhost/jukeboxwall.html" scrolling="no" noresize>
<noframes>
<body bgColor=#336699>
</body>
</html>
method
Re: Why the html part does not print in this perl script?
I don't think a Perl interpreter parses the raw HTML within it. I think you'd have to use Print to print all the HTML you need. Unlike PHP, I'm not sure if Perl does have a special Perl and HTML formatting tag (IE: <?php ?>).
Perl isn't my thing :|
chem
Re: Why the html part does not print in this perl script?
cN is right... and in addition, I don't believe there are any perl tags. Just complete perl files, so the entire html would need to be in print statements.
Re: Why the html part does not print in this perl script?
No, both the previous posters are wrong. The HEREDOC syntax of your print is fine.
The problem is that you don't import whatever module contains HTMLGetRequest. As a result, Perl emits an error. The web server thus receives no well-formed HTTP headers (these would be written by HTMLContentType) and complains about the violation of the CGI protocol.
The solution is to import whatever module you need.
Re: Why the html part does not print in this perl script?
Thank u CornedBee for your nice reply. do u mean i need to insall any software to handel the html? could u tell me what module? furthermore do u mean i just put this line in my code : use CGI;
Re: Why the html part does not print in this perl script?
I have no idea what module. Undoubtedly this code comes from some tutorial, right? So there must be the mention of a module somewhere in this tutorial.
Re: Why the html part does not print in this perl script?
Quote:
Originally Posted by CornedBee
No, both the previous posters are wrong. The HEREDOC syntax of your print is fine.
The problem is that you don't import whatever module contains HTMLGetRequest. As a result, Perl emits an error. The web server thus receives no well-formed HTTP headers (these would be written by HTMLContentType) and complains about the violation of the CGI protocol.
The solution is to import whatever module you need.
Ah... So you learn something new every day. I had assumed Perl would be very similar to PHP.