473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Running a perl script from an ASP page to include QUERY_STRING

I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsearch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."

That is now what I am attempting to do. I found this page:
http://www.wrensoft.com/zoom/support/faq_ssi.html
which recommends using this to run the script:
<%
Dim WshShell, env
Set WshShell = CreateObject("WScript.Shell")
Set env = WshShell.Environment("Process")
env.Item("REQUEST_METHOD") = "GET"
env.Item("QUERY_STRING") = Request.QueryString
set oExec = WshShell.Exec(Server.MapPath("search.cgi"))
oExec.StdOut.ReadLine() ' skip the HTTP header line
Response.Write(oExec.StdOut.ReadAll())
%>
However, when I do this, I get an error message:
WshShell.Exec error '800700c1'
docsearch.pl is not a valid Win32 application.

How can I run a perl script file, ensuring that it receives the
QUERY_STRING from the parent URL and include the output in my asp file?

Thanks
Ben

Oct 17 '06 #1
4 3737
You will have to grab the query string and call the perl script. The other
option is to call the perl script directly and have it re-direct to the
page. Which option you choose depends on your unique application needs and
the amount of interaction with the page.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
"benwylie" <be******@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
>I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsearch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."

That is now what I am attempting to do. I found this page:
http://www.wrensoft.com/zoom/support/faq_ssi.html
which recommends using this to run the script:
<%
Dim WshShell, env
Set WshShell = CreateObject("WScript.Shell")
Set env = WshShell.Environment("Process")
env.Item("REQUEST_METHOD") = "GET"
env.Item("QUERY_STRING") = Request.QueryString
set oExec = WshShell.Exec(Server.MapPath("search.cgi"))
oExec.StdOut.ReadLine() ' skip the HTTP header line
Response.Write(oExec.StdOut.ReadAll())
%>
However, when I do this, I get an error message:
WshShell.Exec error '800700c1'
docsearch.pl is not a valid Win32 application.

How can I run a perl script file, ensuring that it receives the
QUERY_STRING from the parent URL and include the output in my asp file?

Thanks
Ben

Oct 17 '06 #2
On Oct 17, 2:10 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamMwrote:
You will have to grab the query string and call the perl script.
Can you give me some pointers on how I can "call the perl script" or
where I can find out how to do that?

On this page:
http://www.codecomments.com/message819530.html
It seems to suggest doing this:
my $returnValues = `perl somescript.pl`;
but that doesn't seem to work for me.

Any pointers as to how I can do what you have said would be helpful.
Thanks
Ben

Oct 17 '06 #3
"benwylie" <be******@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsearch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
http://groups.google.com/group/micro...ae0d85395a3d72
I was recommended: "to a simple ASP page which will easily do exactly
what you want because it actually has the functionality you want, by
intention, and is supported."
>>
I believe you have misinterpreted this advice. I think David was
suggesting you create an ASP page written with perl to do what you need.
See:

http://msdn.microsoft.com/library/de...a95b344a60.asp

I've never used perl so I will probably not be able to offer further
assistance.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 17 '06 #4
Hi Ben!

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomschrieb im Newsbeitrag
news:Oq**************@TK2MSFTNGP02.phx.gbl...
>"benwylie" <be******@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegr oups.com...
I am running IIS 6.0 on Windows 2003.

I would like to be able to run a perl script from a web page and
include the output.
I have tried doing it with an ssi:
<form action='docsearch.shtml' method='get'>
<!--#exec cgi="/cgi-bin/docsearch.pl-->
</form>

This correctly ran the script, but it was unable to include the
QUERY_STRING from the parent URL into the included perl script, and
there seems no work around to enable me to do that on IIS 6.0,
therefore on this thread:
I had the same problems a few weeks before.
ASP doesn't support most of the SSI commands, AFAIL only the "include"
command.

IU solved my problem using the hints on the article "How do I read the
contents of a remote web page?"
from
http://classicasp.aspfaq.com/general...-web-page.html .
Eventually you have to install the "MSXML and XML Core Services" described
in the article.

After installation I had only add a few lines like:

<%
url =
"http://<myhosturl>/cgi-bin/counter/Counter.pl?Silent=1&CntName=<myCountername>"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.Write xmlhttp.responseText
set xmlhttp = nothing
%>

to include a perl based counter called from the asp page including the given
GET params.

HTH,

Ralf

Oct 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sandman | last post by:
The subject says it all. I am doing a: I have a perl script in which I am using a ReadParse routine that parses the $ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'} which are two variables passed...
1
by: rk | last post by:
Hi, I'm trying to write a cgi/perl programs to post a report like the following format in which the the user has to feed the values(nos) in the boxes under % Done Qual Rel. Stab P1 p2 P3.......
6
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg)...
4
by: jonniethecodeprince | last post by:
Greetings all. I have a problem with PERL and SQL Server. I need to upload a database query to a web page using PERL and SQL Server. I have tried to do this myself but nothing displays on the...
10
chunk1978
by: chunk1978 | last post by:
hi everyone... i've recently noticed some strange .php scripts that are automatically added to some folders on my server... this one is called "47481.php" <?...
6
saranjegan
by: saranjegan | last post by:
Hello, Though i can make my script work well with perl , when am supposed write a script in C its giving error named 500 internal server error i have even tried with some example programs from net am...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
15
by: JWest46088 | last post by:
Hi. I need to create 3 pages. Page 1 requests the number of elements the user wants to add and average. Page 2 asks the user for the numbers. Page 3 adds and averages the numbers and displays...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.