Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Interprocess / Skript to Skript

Reply
Thread Tools

Interprocess / Skript to Skript

 
 
clqrq@yahoo.de
Guest
Posts: n/a
 
      01-09-2006
Hi there, i'm a little bit stuck with my programm and need help, so
let me reduce it to the problem...

I have two skripts; the first does the following:
It saves the Process-ID ($$) to a file and enters a loop, waiting for
Strings.

The second shall read the PID from file and till here, everything is
fine. Now, skript #2 shall send a string (lets say $test='Hallo' to
Skript #1 and wait for reply. What I dont understand is:

How can Skript #2 send a string to Skript #1?
How can Skript #1 get the String.

- - -
#!/usr/bin/perl

#####################################
The First Skript
#####################################

if (open(BS,'>','../server.pid')) {
print BS $$;
close BS;
}

#
# here we need a loop, checking for incoming messages
# and processing strings, then returning them to sender
# - one special message shall break the loop
#

exit;

- - - -

#!/usr/bin/perl

#####################################
The Second Skript
#####################################

$test='hallo';

if (open(BS,'<','../server.pid')) {
$Server-PID=<BS>;
close BS;
}

print &CallServer($Server-PID,$test);

exit;

sub CallServer {
my $answer=''; # the answer of the server
my $SPID=$_[0]; # servers PID
my $Message=$_[1]; # Message to send

#
# here we need a way to send $$ and one or
# more strings to $Server-PID, waiting for response
#
return $answer;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Start several skripts from one skript osoeder@gmx.de Perl Misc 1 02-21-2006 12:28 PM
SystemVerilog Interprocess Communication - Project VeriPage Update Swapnajit Mittra VHDL 0 12-21-2004 05:11 PM
newbie question: interprocess communication Dave Bartlett ASP .Net 1 05-13-2004 01:27 AM
Skript that reads from Unix Pipe _AND_ interacts by getkey() schwerdy Python 2 10-27-2003 04:11 PM
Skript problem / display in 3 rows ASP General 1 07-30-2003 06:03 AM



Advertisments