in reply to how to solve producer consumer problem in perl when threads are disabled

Something along this line:
#!/usr/bin/perl # code by pg use IO::Handle; use strict; use warnings; $| ++; pipe(PARENT_RDR, CHILD_WTR); if (fork()) { if (fork()) { close CHILD_WTR; while (my $line = <PARENT_RDR>) { print "parent got $line"; } } else { close PARENT_RDR; for (100..110) { print CHILD_WTR "$_\n"; } } } else { close PARENT_RDR; for (0..10) { print CHILD_WTR "$_\n"; } }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: how to solve producer consumer problem in perl when threads are disabled
  • Download Code