use strict; use warnings; use MCE::Hobo; use MCE::Shared; mce_open my $shared_fh, '<', \*DATA; mce_async { print "Start Child\n"; while (<$shared_fh>) { print "C: $_"; sleep 1; } print "Stop Child\n"; }; print "Start Parent\n"; while (<$shared_fh>) { print "P: $_"; sleep 1; } print "Stop Parent\n"; MCE::Hobo->waitall; __DATA__ a b c d e f g h i j