NAME
File::Which::Cached
SYNOPSIS
use File::Which::Cached 'which';
my $perl_bin = which('perl');
DESCRIPTION
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.
which()
argument is name of executable, returns abs path to file. takes one argument at a time.
SEE ALSO
File::Which
AUTHOR
Leo Charre leocharre at cpan dot org