It's not so easy to do that. you should use the signal to communicate between childs and parent.
-----Original Message----- >From: Saurabh Singhvi <[EMAIL PROTECTED]> >Sent: Mar 14, 2006 3:57 AM >To: Perl FAq <beginners@perl.org> >Subject: forking doubt > >Hi all, > > > my $child = fork (); > > unless ($child) { > sleep 5; > print "child\n"; > } > > print "parent\n" if $child; > print "parent2\n" if $child; > > >the above code prints the parent lines followed by the child. Now what i >want to do is print the parent >line1 and then the child followed by the parent2 line. So what changes do i >need to do?? > >thanks >Saurabh -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>