File Coverage

blib/lib/Plient/Protocol/File.pm
Criterion Covered Total %
statement 6 13 46.1
branch 0 2 0.0
condition 0 2 0.0
subroutine 2 5 40.0
pod 0 3 0.0
total 8 25 32.0


line stmt bran cond sub pod time code
1             package Plient::Protocol::File;
2              
3 2     2   1504 use warnings;
  2         5  
  2         719  
4 2     2   11 use strict;
  2         6  
  2         471  
5             require Plient::Protocol unless $Plient::bundle_mode;
6             our @ISA = 'Plient::Protocol';
7              
8 0     0 0   sub prefix { 'file' }
9 0     0 0   sub methods { qw/get/ }
10              
11             sub get {
12 0     0 0   my ( $file, $args ) = @_;
13 0           $file =~ s!file:(?://)?!!; # file:foo/bar is valid too
14 0 0 0       open my $fh, '<', $file or warn "failed to open $file: $!" and return;
15 0           local $/;
16 0           <$fh>;
17             }
18              
19             1;
20              
21             __END__