473,732 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 9591
In article <ek************ *****@news20.be llglobal.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.infosystem s.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
5081
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 to the script under usual SSI (.shtml) containing form data submitted to the page from which the script is executed from. Well, since switching to PHP, I have moved most of my perl scripts to php equivalents, but there are a few perl scripts...
4
3599
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 in my variables ?? note1: I'm not the one who wrote the web service.. so I can't modify
2
3078
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 = IO::Socket::INET->new( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => 4);
4
8534
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 unique session ID in a cookie and referencing the SSN from the Session ID would be the correct way to do this. But since we have two separate servers, IIS and Websphere, how do we coordinate the session ID?
3
14943
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
58
10167
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 code... TCHAR myArray; DoStuff(myArray);
3
1570
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 page needs to reference. Thanks Lee
2
380
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 session variables? Is there not a way to create properties in the one screen and then pass some sort of reference to the screen you are calling? Can you point me to an example or an article on how to use? Thanks in advance for your...
3
3672
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 %> <HTML> <BODY> <% use warnings; use strict;
0
8774
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.