user_func => sub { # worker chunk routine my ($mce, $chunk_ref, $chunk_id) = @_; my $output = ''; open my $fh, '<', $chunk_ref; while (<$fh>) { tr/-!"#%&'()*,.\/:;?@\[\\\]_{}0123456789//d; s/w(as|ere)/be/gi; s/$RE1/ $W1{lc $1} /g; s/$RE2/ $W2{lc $1} /g; s/$RE3/ $W3{lc $1} /g; $output .= $_; } close $fh; # Output orderly and serially. MCE->relay_lock; print $OUT_FH $output; $OUT_FH->flush; MCE->relay_unlock; }