Communication between Cgi and another perl application

G

Giojo

Hello boy!
I have to make 2 applications in perl running on the same server.. One is
always active and using an infinite loop do something on the server, the
other one is a cgi script that have to comunicate with the always active
application... So I can control remotely my application using a cgi and the
apache server...
Now, I don't know in witch way they should communicate...
1)through text file shared?
2)through memory shared?
I'd prefer the second one, I think is more useful then the first... What do
you think?
Consider that the message are very simple, for example start this... stop
that... etc...
Thank you :)
Giojo
 
G

Gregory Toomey

Giojo said:
Hello boy!
I have to make 2 applications in perl running on the same server.. One is
always active and using an infinite loop do something on the server, the
other one is a cgi script that have to comunicate with the always active
application... So I can control remotely my application using a cgi and
the apache server...
Now, I don't know in witch way they should communicate...
1)through text file shared?
2)through memory shared?
I'd prefer the second one, I think is more useful then the first... What
do you think?
Consider that the message are very simple, for example start this... stop
that... etc...
Thank you :)
Giojo

Use standard interprocess communication mechanisms - shared
memory/semaphores or sockets.

gtoomey
 
B

Bart Lateur

Giojo said:
Now, I don't know in witch way they should communicate...
1)through text file shared?
2)through memory shared?
I'd prefer the second one, I think is more useful then the first... What do
you think?

Tradition is to use sockets (such as TCP).

Also check out the included docs "perlipc"

<http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlipc.html>


A good book on networking with perl is "Network Programming with Perl"
by Lincoln Stein.

<http://modperl.com:9000/perl_networking/>


You can always write a little command line utility that takes its data
from STDIN or via the command line, and passes it along to the server
(=daemon).
 

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

Similar Threads


Members online

No members online now.

Forum statistics

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

Latest Threads

Top