sharing variables-data perl-asp

U

UkJay

Is it possible to pass data between variables when using active server pages
and inserting some perl script in asp?

Also how do you invoke a perl script from an active server page?

Yes I want the best of both worlds ;-)

--
Best Regards,
James (ukjay)

http://www.ukjay.co.uk

Garden WebCam,Photography,Competitions,Weather (AWS)
 
T

Todd W

UkJay said:
Is it possible to pass data between variables when using active server pages
and inserting some perl script in asp?

Also how do you invoke a perl script from an active server page?

Yes I want the best of both worlds ;-)

The "pass data between variables" part I dont understand, but I think you
are looking for PerlScript. ASP in Perl. Here is a quickstart guide:

http://www.4guysfromrolla.com/webtech/021100-1.shtml

trwww
 
M

Matt Garrish

UkJay said:
I'm not looking for perl script
I use it

I want to use perl script in asp
and share data

<%@ Language="PerlScript" %>

You're now using Perlscript in asp.

What exactly is "share data" supposed to mean? You want to store it in
session: $Session->setVariable('key', 'value') or just write it back to
hidden input fields in the next page's form? You'll have to elaborate if you
expect any meaningful help.

Matt
 
U

UkJay

Matt Garrish said:
<%@ Language="PerlScript" %>

You're now using Perlscript in asp.

What exactly is "share data" supposed to mean? You want to store it in
session: $Session->setVariable('key', 'value') or just write it back to
hidden input fields in the next page's form? You'll have to elaborate if
you expect any meaningful help.

Matt


I'll try but this is my prob I'm hopeless at explaining

Ok I use asp which has variables. I then somehow call a perl script from
asp. (not embed it in asp)
This perl script can grab the values from my asp variables, do some work and
then return updated data into my asp variable(s)

I did say I;m no good at explaining Matt



--
Best Regards,
James (ukjay)

http://www.ukjay.co.uk

Garden WebCam,Photography,Competitions,Weather (AWS)
 
M

Matt Garrish

UkJay said:
I'll try but this is my prob I'm hopeless at explaining

Ok I use asp which has variables. I then somehow call a perl script from
asp. (not embed it in asp)
This perl script can grab the values from my asp variables, do some work
and then return updated data into my asp variable(s)

Why do you want to shell out to perl when you're already running perl?
PerlScript is Perl; just running within the asp environment. That said,
there's no reason you can't also shell out to another script using backticks
(but you're going to pay the overhead of starting another perl interpreter
each time):

my $returnValues = `perl somescript.pl`;

Note that I called perl explicitly. I never looked into this too deeply on
Windows, but have always just assumed that the Windows extension mappings
are not available in the shell that is created to execute the command. If
you don't call perl, don't expect your script to run.

The data sharing is certainly not impossible, but not terribly nice either.
Options that spring to mind are to print the variables you want back to
stdout as a string in some delimited fashion and then split that string from
your within your asp script. Or you could go the more powerful route and use
the Storable module to write the data structures to file and then send that
filename back to your script to read them back in.

You may find yourself limited in terms of what you can run and do from a
shell, though. You will be running with limited rights no matter what server
you're using.

In other words, reconsider why you want to write a separate script!

Matt
 
U

UkJay

<snip>
Why do you want to shell out to perl when you're already running perl?
PerlScript is Perl; just running within the asp environment. That said,
there's no reason you can't also shell out to another script using
backticks (but you're going to pay the overhead of starting another perl
interpreter each time):

my $returnValues = `perl somescript.pl`;

Note that I called perl explicitly. I never looked into this too deeply on
Windows, but have always just assumed that the Windows extension mappings
are not available in the shell that is created to execute the command. If
you don't call perl, don't expect your script to run.

The data sharing is certainly not impossible, but not terribly nice
either. Options that spring to mind are to print the variables you want
back to stdout as a string in some delimited fashion and then split that
string from your within your asp script. Or you could go the more powerful
route and use the Storable module to write the data structures to file and
then send that filename back to your script to read them back in.

You may find yourself limited in terms of what you can run and do from a
shell, though. You will be running with limited rights no matter what
server you're using.

In other words, reconsider why you want to write a separate script!

Matt

Thanks for your reply Matt
my $returnValues = `perl somescript.pl`; seems to be what I need
but I do take the point that normally I wouldn't need to shell out to perl.


--
Best Regards,
James (ukjay)

http://www.ukjay.co.uk

Garden WebCam,Photography,Competitions,Weather (AWS)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top