On Sun, Jun 29, 2003 at 05:24:18PM -0400, Andrew Dunstan wrote: > > ----- Original Message ----- > From: "PeterKorman" <[EMAIL PROTECTED]> > > > > I like your solution. But I think I'd code it: > > > > my $psqlpid = open(OUTPIPE,"|-") || die qq(cant fork: $!); > > > > Won't that cause the child to die because it will have 0 in $psqlpid?
Doh!! A rhetorical question, no doubt. ---------------------------------------------------------- #!/usr/bin/perl #except for sigchld, This is better. my $pid; defined($pid=open(X, "|-")) || die qq(cant fork: $!\n); if ($pid){ system(qq(touch parent)); } else{ system(qq(touch child)); }; ---------------------------------------------------------- I wrongly guessed that control would resume at the line following: > my $psqlpid = open(OUTPIPE,"|-") || die qq(cant fork: $!); There are, evidently, many things I'm too stupid to remember;-\ Cheers, JPK ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])