Question: I use [`Test::More`](https://metacpan.org/module/Test%3a%3aMore)

I want to see if one of my functions is called or not. There are two scenarios I have: one will not call my function, the other will. This function is not mocked out, I just want to see if it was called or not.

Answer: 
Something like:

```
my $called;
my $orig_function = \&YourPackage::YourFunction;
{
    no warnings 'redefine';
    *YourPackage::YourFunction = sub { ++$called; goto &$orig_function };
}
# code that may or may not call YourFunction here
ok($called, 'function called');

```
Looks like you're about to invent code coverage reports. Have you seen [Devel::Cover](https://metacpan.org/pod/Devel%3a%3aCover)? It will make your life easier.