What's to stop someone else to revert your patch because he thinks he might remove an unneccessary 'if' clause?

The "normal" solution here would be to change the subroutine to the generic

sub add_stopwords { my @words= @_; for my $word (@words) {

Not that it is any better than the other two solutions but people might know better than to optimize that away without thinking about the consequences

To make sure nobody changes it back a comment could be added. And/or a test for it could be added (best practice for any bug found)

If you want to prod the unpaid, does-it-out-of-the-kindness-of-his-heart author of the module to modernize the code and add tests there are better ways than saying "There is a comment in the code promising something more modern. Is this not a great time to deliver?". I may be wrong, but to me it sounds more like a sugar-coated reproach than an appeal to his kindness.


In reply to Re: Problems with $_ by jethro
in thread Problems with $_ by SilasTheMonk

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.