From: Marius Gavrilescu Date: Sat, 19 May 2018 18:51:52 +0000 (+0100) Subject: Replace File::Slurp with File::Slurper X-Git-Tag: 0.004_002~9 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=c17e7d6329e8a24e6128a9f70e2b597fce1b5b0a;p=io-compress-brotli.git Replace File::Slurp with File::Slurper --- diff --git a/Makefile.PL b/Makefile.PL index 73fe222..0c59c05 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,9 +11,9 @@ WriteMakefile( SIGN => 1, EXE_FILES => [ 'bin/bro-perl' ], PREREQ_PM => { - 'File::Slurp' => '0', - 'Getopt::Long' => '0', - 'Time::HiRes' => '0', + 'File::Slurper' => '0', + 'Getopt::Long' => '0', + 'Time::HiRes' => '0', }, BUILD_REQUIRES => {}, INC => '-Ibrotli/c/include', diff --git a/README b/README index fe25b7d..594824a 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ DEPENDENCIES This module requires these other modules and libraries: -* File::Slurp +* File::Slurper Additionally, it requires a C compiler. diff --git a/bin/bro-perl b/bin/bro-perl index ad35af8..fcd8219 100755 --- a/bin/bro-perl +++ b/bin/bro-perl @@ -6,7 +6,7 @@ use 5.014; use bytes (); -use File::Slurp; +use File::Slurper qw/read_binary/; use Getopt::Long; use Time::HiRes qw/ gettimeofday tv_interval /; @@ -83,7 +83,7 @@ for ( 1..$REPEAT ) { print $ofh $encoded; } else { - my $decoded = read_file( $ifh ); + my $decoded = read_binary( $ifh ); my $encoded = bro( $decoded, $QUALITY, $WINDOW ); $total_size += bytes::length( $decoded ); write_file( $ofh, $encoded ); diff --git a/t/01-uncompress.t b/t/01-uncompress.t index 28907ca..c29fa6e 100644 --- a/t/01-uncompress.t +++ b/t/01-uncompress.t @@ -3,15 +3,15 @@ use v5.14; use warnings; use Test::More tests => 84; -use File::Slurp; +use File::Slurper qw/read_binary/; use IO::Uncompress::Brotli; for my $test () { my ($expected) = $test =~ s/\.compressed.*//r; - $expected = read_file $expected; + $expected = read_binary $expected; - my $decoded = unbro ((scalar read_file $test), 1_000_000); + my $decoded = unbro ((scalar read_binary $test), 1_000_000); is $decoded, $expected, "$test"; open FH, '<', $test; diff --git a/t/02-roundtrip.t b/t/02-roundtrip.t index 3f656e1..f2c40b8 100644 --- a/t/02-roundtrip.t +++ b/t/02-roundtrip.t @@ -3,14 +3,14 @@ use v5.14; use warnings; use Test::More tests => 114; -use File::Slurp; +use File::Slurper qw/read_binary/; use IO::Compress::Brotli; use IO::Uncompress::Brotli; for my $test () { my ($source) = $test =~ s/\.compressed$//r; - $source = read_file $source; + $source = read_binary $source; for my $quality (9,11) { my $encoded = bro($source, $quality);