I ran with the following for comparing with the sed output. See complementary post for a version based on Marshall's implementation.

# Worker function. sub process_chunk { my ($chunk_ref) = @_; $$chunk_ref =~ s/[[:punct:]]//g; $$chunk_ref =~ s/[0-9]//g; $$chunk_ref =~ s/w(as|ere)/be/gi; $$chunk_ref =~ s/ need.* / need /gi; $$chunk_ref =~ s/ .*meant.* / mean /gi; $$chunk_ref =~ s/ .*work.* / work /gi; $$chunk_ref =~ s/ .*read.* / read /gi; $$chunk_ref =~ s/ .*allow.* / allow /gi; $$chunk_ref =~ s/ .*gave.* / give /gi; $$chunk_ref =~ s/ .*bought.* / buy /gi; $$chunk_ref =~ s/ .*want.* / want /gi; $$chunk_ref =~ s/ .*hear.* / hear /gi; $$chunk_ref =~ s/ .*came.* / come /gi; $$chunk_ref =~ s/ .*destr.* / destroy /gi; $$chunk_ref =~ s/ .*paid.* / pay /gi; $$chunk_ref =~ s/ .*selve.* / self /gi; $$chunk_ref =~ s/ .*self.* / self /gi; $$chunk_ref =~ s/ .*cities.* / city /gi; $$chunk_ref =~ s/ .*fight.* / fight /gi; $$chunk_ref =~ s/ .*creat.* / create /gi; $$chunk_ref =~ s/ .*makin.* / make /gi; $$chunk_ref =~ s/ .*includ.* / include /gi; $$chunk_ref =~ s/ .*mean.* / mean /gi; $$chunk_ref =~ s/ talk.* / talk /gi; $$chunk_ref =~ s/ going / go /gi; $$chunk_ref =~ s/ getting / get /gi; $$chunk_ref =~ s/ start.* / start /gi; $$chunk_ref =~ s/ goes / go /gi; $$chunk_ref =~ s/ knew / know /gi; $$chunk_ref =~ s/ trying / try /gi; $$chunk_ref =~ s/ tried / try /gi; $$chunk_ref =~ s/ told / tell /gi; $$chunk_ref =~ s/ coming / come /gi; $$chunk_ref =~ s/ saying / say /gi; $$chunk_ref =~ s/ men / man /gi; $$chunk_ref =~ s/ women / woman /gi; $$chunk_ref =~ s/ took / take /gi; $$chunk_ref =~ s/ tak.* / take /gi; $$chunk_ref =~ s/ lying / lie /gi; $$chunk_ref =~ s/ dying / die /gi; $$chunk_ref =~ s/ made /make /gi; $$chunk_ref =~ s/ used.* / use /gi; $$chunk_ref =~ s/ using.* / use /gi; # Output orderly and serially. MCE->relay_lock; print $OUT_FH $$chunk_ref; $OUT_FH->flush; MCE->relay_unlock; }

In reply to Re^2: Need to speed up many regex substitutions and somehow make them a here-doc list (MCE solution) by marioroy
in thread Need to speed up many regex substitutions and somehow make them a here-doc list by xnous

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.