use strict; use warnings; use MCE::Shared; mce_open my $shared_fh, '<', \*DATA; my $pid= fork(); die unless defined $pid; if ($pid == 0) { print "Start Child\n"; while (<$shared_fh>) { print "C: $_"; sleep 1; } print "Stop Child\n"; } else { print "Start Parent\n"; while (<$shared_fh>) { print "P: $_"; sleep 1; } print "Stop Parent\n"; } __DATA__ a b c d e f g h i j