PDA

View Full Version : Help! - 5-line TCL/Expect script not working on Powweb


rsteedma
12-20-01, 10:16 PM
I am unable to use TCL/Expect for CGI through PowWeb. I am testing a 5-line script that works on my other server, chmod 755.

Function:
Start TCLSH, print the content-type, print a message, terminate.

Location:
http://www.congonetworking.com/try.cgi

Code:
#!/usr/local/bin/tclsh
puts "Content-type: text/html\n\n"
puts ""
puts "<HTML> Visitor Activity Report </HTML>"
return 0;

Error Log:

[Thu Dec 20 10:18:12 2001] [error] [client 128.107.253.43] Premature end of script headers: /www/r/rsteedma/htdocs/try.cgi
failed to open log file
fopen: Permission denied
[Thu Dec 20 10:18:13 2001] [error] [client 128.107.253.43] Premature end of script headers: /www/r/rsteedma/htdocs/try.cgi

Any help would be greatly appreciated!

Thanks,
Ron Steedman

SimCoWeb
12-21-01, 01:30 AM
Hi Ron:

If the code you posted is the script you're trying to run on PowWeb then you need to change the path to perl to this:

#!/usr/bin/perl

rsteedma
12-21-01, 02:07 AM
Hi SimCoWeb, and thanks for replying. :)

My target script is written in the TCL language and uses an interpreter called TCLSH.

I tried making a "Perl Wrapper" for my TCL script but that also failed. It printed ******. I am wondering whether the copy of TCLSH on the server is broken, or there are special "tricks" to making this version work?

perl.cgi
--------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$output = `/usr/local/bin/tclsh /www/r/rsteedma/htdocs/tcl.cgi`;
print "<HTML>TCL Output: ***$output***</HTML>";

tcl.cgi
---------
puts "TCL Working";
return 0;

fcsnc
12-26-01, 07:22 AM
Where is it written that Powweb supports tclsh?

Just curious ...

-Tom

rsteedma
12-26-01, 10:16 AM
I'm not sure about their official position on TCL support, but the servers certainly are having trouble running my scripts.

Since TCL scripts are not working here, I am asking a colleague to translate existing TCL scripts into Perl. In the future, all CGI scripts intended to run on PowWeb will be written in Perl.

Thanks,
Ron