bpleduc Posted November 6, 2002 Posted November 6, 2002 I am new and am learning about SSI, CGI with Perl... 1st) SSI I am not able to get the exec command to work with SSI. I have used other codes fine. I am trying to do somthing simple like: <!--#exec cmd="ls" --> 2nd) CGI/Perl Why is the following needed? use CGI::Carp qw(fatalsToBrowser); I could not get my CGI/Perl to run without this. Quote
Lianna Posted November 7, 2002 Posted November 7, 2002 Please take this the way it's intended...I know nothing about CGI/SSI, etc. but have been able to debug a few small pieces by using the resources here: http://www.cgi-resources.com/Documentation/ Maybe you can find your answers there. Good luck. Quote
rruff Posted November 7, 2002 Posted November 7, 2002 I'm guessing that SNH has the SSI exec directive disabled, as it is a security risk. However, one can achieve similar results with the include directive. For example, create a CGI script to run the ls command: #!/bin/sh echo "Content-type: text/html" echo "" echo "" ls Put this directive in your .shtml file: <!--#include virtual="cgi-bin/script.sh" --> As for your second question, use CGI::Carp qw(fatalsToBrowser) is used to send error messages to the web browser for testing and debugging. What exactly happens when you try to run the script without this? Rob Quote
bpleduc Posted November 7, 2002 Author Posted November 7, 2002 If I do not include this line my cgi scripts would not run. The browser returned an error. I fumbled around for an hour or two trying everything I could think of... Finally I came across the new file under the file manager. When I created a new file with the Perl script template I saw the needed line... As for the exec command I have been told by the help desk that it is turned off. Thanks for the example code to achieve the same result! Quote
rruff Posted November 7, 2002 Posted November 7, 2002 I'm not sure why your script won't run without including CGI::Carp(fatalsToBrowser). I created a simple test script that ran fine without it. Could you post your code so we can see exactly what's going on? Quote
bpleduc Posted November 7, 2002 Author Posted November 7, 2002 Well, it looks like you are right. I removed the line from my .cgi files and they ran fine.... I dont know, there might have been a ghost in my machine when I was trying to get it to work before. I am guessing it had somthing to do with the permissions... But anyhow all is well and I am progressing nicely now. So far I am very pleased with the service you provide here! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.