sharing a variable across two scripts.

R

rajendra

Hello All,

I have two scripts A and B .Script A calls script B for getting data. This
data is used by script A for processing. Is there a concept of shared
variable so that data stored in this shared variable can be accessed by
script A.


With Rgds,
Raj
 
R

rajendra

Hello ,
Thanks for the reply.
To be more specific, I would like to know whether a perl variable(may be a
variable or array or a hash) which can be shared across two different batch
files.

With Rgds,
Raj
 
J

Jürgen Exner

[Please do not top post, trying to repair]
rajendra said:
To be more specific, I would like to know whether a perl variable(may
be a variable or array or a hash) which can be shared across two
different batch files.

I'm guessing you are looking for sharing data between separate processes.

I do not know if there is a Perl module for shared memory but any other IPC
method is available as a module on CPAN.

jue
 
D

Darren Dunham

rajendra said:
Hello All,
I have two scripts A and B .Script A calls script B for getting data. This
data is used by script A for processing. Is there a concept of shared
variable so that data stored in this shared variable can be accessed by
script A.

In general, no. Threads share memory visibility easily, but separate
processes do not. There are several different methods of moving data
between processes. Interprocess communication (IPC).

Write data to a file, read from the other process.
Open a network socket between the processes.
Use SYSV shared memory if supported by the OS.

See also perlipc.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top