On Sun, Jun 29, 2003 at 05:24:18PM -0400, Andrew Dunstan wrote:
>
> ----- Original Message -----
> From: "PeterKorman" <calvin-pgsql-ml@eigenvision.com>
> >
> > 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