use Security::Monitoring::Messaging::Messenger; use 5.14.2; use strict; use warnings; use Carp qw(carp croak); use Storable qw(nstore_fd); my $input = {name=>'inputfile',type=>'named_pipe'}; my $output = {name=>'outputfile',type=>'named_pipe'}; my %params = ( input=>$input, output=>{out1=>$output} ); open my $fh,'>','listenfile'or croak"could not open pipe : $!"; nstore_fd(\%params, $fh); close $fh; WAIT:if(!-e 'inputfile'){ goto WAIT; } my $pid; $pid = fork(); if(!$pid){ print "forked\n"; WAIT2:if(! -e 'outputfile'){ goto WAIT2; } open $fh,'<','outputfile'; print "son listening to outputfile\n"; while(<$fh>){ my $out = $_; print "got : $out"; } } else{ print "I'm the father\n"; my $c = 0; WAIT: open $fh, '>','inputfile' or croak "could not open pipe :$!"; print $fh "trololol $c\n"; $c++; goto WAIT; }