#!/usr/bin/perl use strict; use warnings; my $pid = open(CHILD, "-|"); if ($pid) { # parent print "parent got:\n"; print while(<CHILD>); close CHILD; # this waits on child } elsif ($pid == 0) { # child print "kid here!\n"; exec '/bin/date' or die "Can't exec date $!\n"; } else { die "fork error: $!\n"; }
In reply to Re: simple IPC
by zentara
in thread simple IPC
by keithw99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |