API/Content.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 21 CC 2 SCAR 13.9
CC
2
Cov
0%
encode
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package Imgur::API::Content;
2  
3 use strict;
4 use MIME::Base64;
5  
6 sub encode {
7 my ($class,$path) = @_;
8  
9 if (!-f $path) {
10 return undef;
11 }
12 my $op='';
13 my $buff='';
14 open(FI,$path);
15 while(read(FI,$buff,128*57)) {
16 $op.=encode_base64($buff);
17 }
18 return $op;
19 }
20  
21 1;
22