File Coverage

lib/File/Which/Cached.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 2 100.0
condition 3 3 100.0
subroutine 5 5 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package File::Which::Cached;
2 2     2   59316 use strict;
  2         5  
  2         55  
3 2     2   694 use File::Which();
  2         1012  
  2         34  
4 2     2   9 use Exporter;
  2         9  
  2         78  
5 2     2   8 use vars qw($VERSION @ISA @EXPORT_OK %_cache);
  2         4  
  2         327  
6             @ISA = qw/ Exporter /;
7             $VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)/g;
8             @EXPORT_OK = ('which');
9              
10             sub which {
11 10009 100 100 10009 1 1768159 (! defined $_[0] )
12             ? croak('missing arg to File::Which::Cached::which()')
13             : $_cache{$_[0]} ||= File::Which::which($_[0]);
14             }
15              
16             1;
17              
18             __END__