can't execute a CGI/perl script

Hi, I made a perl script and saved it as cgi-bin/temp.pl and this is what it contains:

print "Content-Type: text/html\n\n";
print "hello";
exit;

I then made an shtml file and saved it in my home directory as temp.shtml and this is what it contains:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
     <title>Untitled</title>
</head>

<body>

<!--#exec cgi="http://niltz0.tripod.com/cgi-bin/temp.pl"-->

</body>
</html>


but when I try to open the page I get an error processing directive.  Any ideas?  Yes I know the first line of the script is not #!/usr/bin/perl or whatever, but that is because it is not required for tripod.  I am able to use <!--#include virtual = "filename" --> so as far as I know <!-- #exec cgi = "filename" --> should work.
niltzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

makerpCommented:
you probably dont have execute permissions. also the file will need to be set for execute using chmod
0
ahoffmannCommented:
1. is your script temp.pl running from command-line?
2. is your web-server configured to allow #exec in SSI?

Please post complete error message.
0
amitabhraiCommented:
In many servers the "Exec" option for SSI is turned off due to security reasons. You might want to verufy whether server is allowed to run "EXEC CGI".
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

SteveFersonCommented:
<!--#include virtual="..."--> should be enough to do what you want.

Most webhosts don't allow extended SSI (inculding the "exec" include) because it can allow people to wreak havoc with the server. This is even true of such hosts as UKlinux.net which is primarily for amateur developers and students writing programs etc so I'm sure tripod won't let you do it, as it's a much more commercial offering.
0
niltzAuthor Commented:
The file has execute permissions.  If you run the script by entering http://niltz0.tripod.com/cgi-bin/temp.pl it will work, but if you go to http://niltz0.tripod.com/temp.shtml then I get the following error:
[an error occurred while processing this directive]

You can see for yourselves by just going to the links.

If I am unable to use <!--#exec cgi="filename"--> then how do I use <!--#include virtual="filename"--> to get the same results?  When I use it I just get the contents of my script being displayed and not the output that the script would generate.  What I want to end up doing is creating a script to generate random quotes and then call this script from a shtml file.  I don't see any other way of doing it other than using <!--exec cgi="..."-->, but then again I am new to CGI so maybe there is a way around it.
0
amitabhraiCommented:
You can try using
<IFRAME SRC="http://niltz0.tripod.com/cgi-bin/temp.pl">
(for IE)
or
<LAYER SRC="http://niltz0.tripod.com/cgi-bin/temp.pl">
( for Netscape)

instead of "EXEC CGI"
0
SteveFersonCommented:
using an "include virtual" directive should produce the right result if it's used correctly, unless perhaps it's been disabled by the server owners in which case your best bet is to find a better host.  If you're in the UK try UKLinux.net
0
niltzAuthor Commented:
I don't think "include virtual" is disabled because there are sample scripts that tripod gives us to use and the way we execute them is with a "include virtual" statement.

I would rather stay away from IFRAME and LAYER since I want this to work on all browsers and not just IE or Netscape.
0
SteveFersonCommented:
I know it says tripod doesn't need them, how about trying to put the shebang line in at the top? Or do tripod not tell you where Perl is on the server?
0
niltzAuthor Commented:
Tripod doesn't tell us where Perl is.  I have tried putting #!usr/bin/perl at the top anyway but it doesn't help.

When I try to use "include virtual" does my script need to contain anything special?  Or is what I posted at the top fine?
0
ahoffmannCommented:
you have little chance to find the reason if you haveno accessto the web-servers error-log,
Ask the admin to give the detailed error messages, or you just can guessing ..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveFersonCommented:
Try #!usr/local/bin/perl

I really suggest you try a new host, like hypermart.net or virtualave.net - both of whom allow you access to your error logs AND let you know where Perl is. (They also have confirmed support for SSI)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.