Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Use cases for 'sub Pckg::func { }' ?

by Tux (Canon)
on Aug 01, 2020 at 09:14 UTC ( [id://11120183]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Use cases for 'sub Pckg::func { }' ?
in thread Use cases for 'sub Pckg::func { }' ?

I find a few reasons to not oppose to this (considered evil) path:

  1. Using a module that is not maintained and nobody took over, several patches were proposed but nobody uploaded a fixed version.
    Of course you can apply the patches locally before you install it, but that is no guarantee it is also fixed on other systems.
    It is way more reliable to overrule the faulty sub or make a new one foced into the faulty package thereby making sure it works.
  2. The package owner/maint has explicitely said *not* to add the requested/required functionality (they might even have documented so), so adding the desired method by forcing it into the package is relatively safe. (problematic would only be a new maintainer who disagrees with the refusal and putting it in later anyway)
  3. When working in supporting a module that is evolving, adding methods that are not yet implemented or have been removed, all guarded by version checks is a very fine way to make your module work for the end-users regardless of the changes in the underlying module(s). I do this very regularly. (example)
  4. Overruling CORE::GLOBAL functions in test files to provide stubs.

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120183]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-24 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found