473,396 Members | 2,002 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,396 software developers and data experts.

Passing Variables from One Perlscript to Another

Joe
I am trying to write a Perlscript to be used with some HTML pages. Here is
how it works:

1.. The first HTML page has a form which requests for user input. Then it
passes the QUERY_STRING to a Perl script.
2.. The Perl script will then validate the data. If input validation
fails, it returns to the previous screen and asks the user to retry. If the
validation passes, it display the user input and asks for confirmation.
3.. If the user chooses okay to proceed, it will pass the validated data
to another Perl script to execute some queries from a database.
I can manage to go from step 1 to step 2. But I don't know how to pass the
variables from one Perl script to another. I am not sure if I should use
the POST or GET method. I think there should be some better ways.


Jul 19 '05 #1
1 9558
In article <ek*****************@news20.bellglobal.com>, Joe
<pa****@netzero.com> wrote:
I am trying to write a Perlscript to be used with some HTML pages. Here is
how it works:

1.. The first HTML page has a form which requests for user input. Then it
passes the QUERY_STRING to a Perl script.
2.. The Perl script will then validate the data. If input validation
fails, it returns to the previous screen and asks the user to retry. If the
validation passes, it display the user input and asks for confirmation.
3.. If the user chooses okay to proceed, it will pass the validated data
to another Perl script to execute some queries from a database.
I can manage to go from step 1 to step 2. But I don't know how to pass the
variables from one Perl script to another. I am not sure if I should use
the POST or GET method. I think there should be some better ways.


This really isn't a perl question, but one about CGI programming. You
might get better results in another newsgroup, such as
comp.infosystems.www.authoring.cgi. This newsgroup (comp.land.perl) is
actually defunct, and you should try comp.lang.perl.misc for perl
questions in the future.

You pass variables from one perl script to another pretty much like any
other language: as command line arguments, subroutine variables,
environment variables, or something more complicated, depending upon
your platform and whether or not the two scripts are running within the
same process or not.

From your description, it sounds like the two scripts are called
separately at different times by two different web browser requests.
The methods for getting information from the first script to the second
are not language specific, but your general choices are: query
parameters, form data, or cookies.

I am assuming that the first script generates the page that invokes the
second script. Then you can: 1) add the data to the link that invokes
the second script, if it is a link, or, if it is a form, put the data
in a form and then process the form data in the second script. If you
don't want the user to see or be able to edit the data, put the data in
hidden form elements. Your second script will receive them anyway.

You can also send the user a cookie in the response to the first form.
Then, if the user does not have cookies disabled, you will receive the
cookie with the request for the second form.

You should consider using the CGI.pm module if you are not already
doing so.
Jul 19 '05 #2

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...
4
by: Amr Mostafa | last post by:
Hello :) I'm trying to write a script that deals with a web service. I'm using NuSoap class. my question is : Can I pass some variables By Reference to the web service and get the result back...
2
by: KaXo | last post by:
I use PerlScript in ASP, where got a Error, IIS will send the Error messenge to client. how to resume asp running? my asp need to handle the errors. For Example: $r_socket =...
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
3
by: Lee | last post by:
Hi All How can I pass options from one webpage into another webpage. When the user clicks on the hyperlink I want them to be go to the next page but I need to pass in a number that the next...
2
by: Jim Heavey | last post by:
I know that I can create session variables and pass those values from one screen to another, but is there not a way to makes variables from one scree n available to another screen other then...
3
by: DavidCZ | last post by:
I have a page using Perlscript in ASP. I installed ActivePerl 5.6, 5.8, and 5.10 to no success. I am running the page in IIS on XP SP3. The program is as follows: <%@ Language=PerlScript %> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.