#!/usr/bin/perl -w #ipcprocesses.pm. ... sub new { my $class = shift; my $this = { 'field' => 1 }; bless ($this,$class); tie $newvalue,'IPC::Shareable','kali'; return ($this); } ... sub DO_newchild { my $this = shift; ... if ($pid = fork) { #parent $this->{'field'} = $newvalue; ... } else{ my $newvalue; tie $newvalue,"IPC::Shareable",'kali'; #### sub new { my $class = shift; #my $this = { 'field' => 1 }; my $this = { }; bless ($this,$class); tie $this->{'field'},'IPC::Shareable','kali'; $this->{'field'} = 1; return ($this); } ... sub DO_newchild { my $this = shift; if ($pid = fork) { #parent # $this->{'field'} = $newvalue; $num_children++; print 'parent '.$$.' | '.$this->{'field'}."\n"; return; } else{ #my $newvalue; #tie $newvalue,"IPC::Shareable",'kali'; #Children can not return from this subroutine $SIG{INT} = 'DEFAULT'; #make SIGINT kill us as it did before while(1) { sleep 2; print 'child '.$$.' | '.$this->{'field'}."\n"; #$newvalue = time(); $this->{'field'} = time; } } exit; }