Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Unless you always have the same version on production and every development machine. Otherwise one machine upgrades, finds the bug is still there, changes the version number, and breaks everyone else.

    You should indicate whether versions after the last are fixed, or just not tested. That way you can distinguish between, "I'm continuing to patch this machine that has not been upgraded yet" and "I'm not patching this current machine" and "Check whether this monkeypatch is still needed now!"

    Of course once you put these two pieces of functionality together, then you suddenly want a different module. Now the module you want would have different patches for different ranges of versions. There are many possible APIs for this. I'd personally lean towards having a bunch of chunks of code in DATA which are separated by something indicating which range of versions gets that monkeypatch. But use your imagination, you might find something else clearer and cleaner than that.

    If you take this advice then I'd suggest calling the module that enables it MonkeyPatch. So it could look something like this for something that will patch versions 1.24-1.26 and would die on version 1.27:

    package HTTP::Request::Common;
    use MonkeyPatch;



    #####PATCH: 1.24 - 1.26 : die

    sub DELETE { _simple_req('DELETE' , @_); }