Instance
With Mock::Quick you can mock object instances on the fly, no need for a package. This defines an object with 3 methods, the first simply returns a value, the second is a custom method, the third returns a subref. This will remove the method code from the method_name2 turning it into an empty read/write accessor. Any method you do not define will auto-vivify as a read/write accessor. This is the same as qobj, except that there is no method auto-vivifying.
Class
You can implement a class, this also prevents the real one from loading at all. You can takeover an already loaded class, then override any methods on that class: You can use the control object to apply more overrides, or restore original method. When the $control object is destroyed, or falls out of scope the original methods are all restored. This means you need to pay attention to your control object and make sure you store it until it is not needed.
Fennec

What Fennec brings to the party

Note: Fennec 2.009 or greater is required for this.

As seen in the previous sections, Mock::Quick functions return a control object that you need to keep track of. If you fail to capture the control object a warning is issued because your mock is immedietly destroyed.

In Fennec, Mock::Quick functions where the return object is ignored, will act as setup/teardown specifications. That is if you use qtakeover in a describe block, the mocking will effect any test blocks (as well as setup/teardown blocks) within that describe. The mocking however will NOT apply to the describe block itself.

On top of that you can use qtakeover and similar functions inside the test block and safely ignore the returned control object.