Utils/File.pm

filter: Statementstmt 63.6% 7 / 11 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 100% 1 / 1 totaltotal 56.2% 9 / 16 CC 2 SCAR 14.7
CC
2
Cov
54%
slurp_file
6.0
BEGIN
1.0
CRAP 4.3
« Utils/Hash.pm ↑ Summary Utils/String.pm »
1 #===============================================
2 package Banal::Utils::File;
3  
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 require Exporter;
6  
7 2 @ISA = qw(Exporter);
8 2 @EXPORT_OK = qw(slurp_file);
9  
10  
11  
12 ##############################################################################"
13 # Utility functions
14 ##############################################################################"
15  
16 #------------------------------------------------------------
17 # Slurps an entire file into memory and returns the resulting string
18 #-------------------------------------------------------------
19 0 ▶sub slurp_file {
Subroutine slurp_file: not called CC=2 SCAR=17.9
Pod documented
20 0 my $file = shift;
21
22 0 local( $/ ) ;
23 0 ▶ open( my $fh, $file ) or die __PACKAGE__ . " : slurp_file : Can't open file $file\n";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, $file or die 'Banal::Utils::File' . " : slurp_file : Can't open file $file\n" 0 0 0
24 0 return <$fh>;
25 }
26  
27  
28 2 1;
29  
30  
31 __END__
« Utils/Hash.pm ↑ Summary Utils/String.pm »