Ssi And Cgi Questions

I am new and am learning about SSI, CGI with Perl...<br /><br />1st) <br />SSI<br />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:<br /><!--#exec cmd="ls" --><br /><br />2nd)<br />CGI/Perl<br /><br />Why is the following needed?<br />use CGI::Carp qw(fatalsToBrowser);<br /><br />I could not get my CGI/Perl to run without this.<!--content-->
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:<br /><br /><a href="http://www.cgi-resources.com/Documentation/" target="_blank">http://www.cgi-resources.com/Documentation/</a><br /><br />Maybe you can find your answers there. Good luck.<!--content-->
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:<br /><!--fonto:Courier--><span style="font-family:Courier"><!--/fonto--><br /><!--coloro:blue--><span style="color:blue"><!--/coloro--><br />#!/bin/sh<br /><br />echo "Content-type: text/html"<br />echo ""<br />echo ""<br />ls<!--colorc--></span><!--/colorc--><!--fontc--></span><!--/fontc--><br /><br />Put this directive in your .shtml file:<br /><!--fonto:Courier--><span style="font-family:Courier"><!--/fonto--><!--coloro:blue--><span style="color:blue"><!--/coloro--><!--#include virtual="cgi-bin/script.sh" --><!--colorc--></span><!--/colorc--><!--fontc--></span><!--/fontc--><br /><br /><br />As for your second question, <!--coloro:blue--><span style="color:blue"><!--/coloro-->use CGI::Carp qw(fatalsToBrowser)<!--colorc--></span><!--/colorc--> 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?<br /><br />Rob<!--content-->
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...<br /><br />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!<!--content-->
I'm not sure why your script won't run without including <!--coloro:blue--><span style="color:blue"><!--/coloro-->CGI::Carp(fatalsToBrowser)<!--colorc--></span><!--/colorc-->. I created a simple test script that ran fine without it.<br /><br />Could you post your code so we can see exactly what's going on?<!--content-->
Well, it looks like you are right. I removed the line from my .cgi files and they ran fine....<br /><br />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... <br /><br />But anyhow all is well and I am progressing nicely now. So far I am very pleased with the service you provide here!<!--content-->
 
Top