File-Which-Cached

 view release on metacpan or  search on metacpan

lib/File/Which/Cached.pm  view on Meta::CPAN

This is a wrapper around File::Which that caches results to a package symbol.
If you have a sub or method that makes multiple calls to which, and maybe the
same executable lookup, you may want to do this.

File::Which does not cache results in the package. That means that if you call 
which twice for the same executable, it performs twice.

This module will save the result, so that if your code is called to lookup an 
executable a thousand times, it takes just as long as one time.

This is desirable in iterations of many calls, etc.
In 2 thousand calls, we save one second.

=head1 SUBS

Not exported by default.

=head2 which()

Argument is name of executable, returs abs path to file.
Takes one argument at a time.



( run in 1.486 second using v1.01-cache-2.11-cpan-71847e10f99 )