If modifying foo is not an option, then I would also suggest to do some timing tricks.
But maybe you can modify foo such, that when called in array context, it returns an indicator if the data was retrieved from the cache or not?
# normal use $res = foo($arg); # test use ($res, $cached) = foo($arg);
In reply to Re: How to test caching?
by Perlbotics
in thread How to test caching?
by JavaFan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |