.ASP calling Perl SSI

I have a very complex Server Side Perl script stored in a file called "complex.pl".

I have a very simple Active Server Page (Server Side) called "helloworld.asp".

I run both on IIS 5.

I want my ASP to call my Perl script. I want both to be server side interpetted, ran, and then rendered.

I'm only getting as far as getting my ASP ran by the server, but the SSI command executing the Perl Script being printed in my output view source.

For instance, my source looks like this:

response.write "Hello. Here is the output of my complex script below:<p>" & vbcrlf
<!--#exec cgi="/cgi-bin/complex.pl"-->

Any my redered "view source" looks like this:

Hello. Here is the output of my complex script below:
<!--#exec cgi="/cgi-bin/complex.pl"-->

What's wrong here?

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.

I'm not convinced that this will work.  The ASP will be parsed by the ASP parser/interpretter, not the Perl one...
A little more detail on this thought - server side includes will not function, for instance, in the output of a Perl CGI Script.  This is because the Perl/CGI interpretter is producing the results, and the page produced is  not 'reparsed' by the server parser that interprets the server side includes.

I would expect that this would work in a similar fashion - that the ASP parser won't reparse the output of the ASP program.  

Instead, if this can be done, I would expect that you would need to call the Perl program from within the ASP code.
Ah, I found the answer in the O'Reilly book 'ASP in a Nutshell'.  Only the #include directive is allowed in both HTML and ASP pages.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Here's different thought - what about including an ASP script and a Perl script within a .shtml file, like:

<!-- #exec cgi="/cgi-bin/perscript.pl" -->
<!-- #exec cgi="/aspscript.asp"-->
Hmmm - here's some more promising information.  Are you on a server that uses ActiveState's ActivePerl?  Then you can do perl from within ASP:

KennedyStephenAuthor Commented:
Wow. Thank you for a quick response! I really appreciate your help. I thank you so much.

I'm beginning to think this IS impossible.

We do use ActivePerl. But those instructions on the link you provided use a "special form" of Perl built inside an ASP. The "special form" of Perl is not very friendly and cannot produce the same results as my "complex" Perl script. I am looking to run a "normal" Perl script in an ASP.

Also, I pass FORM VARIABLES from one .ASP to another. When I build the .ASP inside the .SHTML I lose my ability to use the FORM VARIABLES that get passed from one .ASP to another.

This seems like something one SHOULD be able to do very easily. I couldn't imagine how hard this was going to be.
You'd think it would be easy, but I haven't yet found any evidence that an external program can be run and return results to the asp one....

Hmmm - could you use PerlScript to execute an external program?  I.e. can you do this:

$somevariable = `perl /path/to/program/yourscript.pl`;


system('perl /path/to/program/yourscript.pl');

or the like?
Here's more on that idea:

AspExecâ„¢ - allows you to execute DOS and Windows apps. DOS programs which return results via stdio can be executed and the results are returned as a string. You can optionally set a timeout to wait for either Dos or Windows applications.


(found this through the following conversations:

which also mentions that there is a Microsoft-supplied component, "WScript.WShell" that you can use to do this, like:

Dim oShell, myShell
Set oShell = Server.CreateObject ("WScript.Shell")
oshell.run "command"

you can not run PERL in ASP,
but you can use frame/iframe in ASP page where you refer to perl file.

That is what I do when have some perl pages and I am too lazy to rewrite it in ASP or it is too difficult to make it in ASP

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
PashaMod - I think that hamidovt  has the answer - i.e. that it really can't be done.
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
Web Development

From novice to tech pro — start learning today.